Skip to content

Commit 800a78f

Browse files
Ander Conselvan de Oliveiragregkh
authored andcommitted
drm/i915: Don't leak edid in intel_crt_detect_ddc()
commit c34f078675f505c4437919bb1897b1351f16a050 upstream. In the path where intel_crt_detect_ddc() detects a CRT, if would return true without freeing the edid. Fixes: a2bd1f5 ("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: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani 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 c96b63a6a7ac4bd670ec2e663793a9a31418b790) Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d79e411 commit 800a78f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/gpu/drm/i915/intel_crt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
445445
struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
446446
struct edid *edid;
447447
struct i2c_adapter *i2c;
448+
bool ret = false;
448449

449450
BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG);
450451

@@ -461,17 +462,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
461462
*/
462463
if (!is_digital) {
463464
DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
464-
return true;
465+
ret = true;
466+
} else {
467+
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
465468
}
466-
467-
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
468469
} else {
469470
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n");
470471
}
471472

472473
kfree(edid);
473474

474-
return false;
475+
return ret;
475476
}
476477

477478
static enum drm_connector_status

0 commit comments

Comments
 (0)