drm/i915/hdmi, dp: Do not dereference the encoder in the connector destroy
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Sep 2014 20:43:45 +0000 (21:43 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Sep 2014 12:41:12 +0000 (14:41 +0200)
Oops, apparently intel_hdmi/intel_dp is the encoder - an object with a
distinct lifetime to the connector, and so we cannot simply reuse the
common function to unset and free the edid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_hdmi.c

index 2a26774ddb68771e9eb73c269a455c09a7c4c229..c973cd6bb4f58a3c48bff6acc369c37c7a02774a 100644 (file)
@@ -4395,7 +4395,7 @@ intel_dp_connector_destroy(struct drm_connector *connector)
 {
        struct intel_connector *intel_connector = to_intel_connector(connector);
 
-       intel_dp_unset_edid(intel_attached_dp(connector));
+       kfree(intel_connector->detect_edid);
 
        if (!IS_ERR_OR_NULL(intel_connector->edid))
                kfree(intel_connector->edid);
index c5861736b4b0f97fbea8f73554e525303ee8f8fb..7fed5bedc10f616b3e9cf85730d30a4d8714bac0 100644 (file)
@@ -1501,7 +1501,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)
 
 static void intel_hdmi_destroy(struct drm_connector *connector)
 {
-       intel_hdmi_unset_edid(connector);
+       kfree(to_intel_connector(connector)->detect_edid);
        drm_connector_cleanup(connector);
        kfree(connector);
 }