Commit 800a78f9 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Greg Kroah-Hartman

drm/i915: Don't leak edid in intel_crt_detect_ddc()

commit c34f0786 upstream.

In the path where intel_crt_detect_ddc() detects a CRT, if would return
true without freeing the edid.

Fixes: a2bd1f54 ("drm/i915: check whether we actually received an edid in detect_ddc")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484922525-6131-1-git-send-email-ander.conselvan.de.oliveira@intel.com
(cherry picked from commit c96b63a6)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d79e4118
...@@ -445,6 +445,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) ...@@ -445,6 +445,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private; struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
struct edid *edid; struct edid *edid;
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
bool ret = false;
BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG);
...@@ -461,17 +462,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) ...@@ -461,17 +462,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
*/ */
if (!is_digital) { if (!is_digital) {
DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n"); DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
return true; ret = true;
} } else {
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n"); DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
}
} else { } else {
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n"); DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n");
} }
kfree(edid); kfree(edid);
return false; return ret;
} }
static enum drm_connector_status static enum drm_connector_status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment