Skip to contentSkip to conversation

drm/i915: Cleaning up encoder in the end on intel_dp_encoder_destroy

PATCH In review Sonika Jindal 2 participants 2 messages Jan 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Cleaning up encoder in the end on intel_dp_encoder_destroy

We clean up the encoder and then try to acquire pps_lock where it tries to get the encoder. So moving the cleanup to the end.

---
 drivers/gpu/drm/i915/intel_dp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +2 -2
index 64c7578..92415f4 100644
@@ -4317,8 +4317,6 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
 	struct intel_dp *intel_dp = &intel_dig_port->dp;
 
 	drm_dp_aux_unregister(&intel_dp->aux);
-	intel_dp_mst_encoder_cleanup(intel_dig_port);
-	drm_encoder_cleanup(encoder);
 	if (is_edp(intel_dp)) {
 		cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
 		/*
@@ -4334,6 +4332,8 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
 			intel_dp->edp_notifier.notifier_call = NULL;
 		}
 	}
+	intel_dp_mst_encoder_cleanup(intel_dig_port);
+	drm_encoder_cleanup(encoder);
 	kfree(intel_dig_port);
 }
 
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 5 lines · Sonika Jindal

We clean up the encoder and then try to acquire pps_lock where it tries to get the encoder. So moving the cleanup to the end.

Already fixed

commit c8bd0e49519ce1d80196e54ba2e20c3a1b7c88c0

Author: Imre Deak <[email protected]>
Date:   Fri Dec 12 17:57:38 2014 +0200

drm/i915: fix use after free during eDP encoder destroying

Quoted 33 lines
---
 drivers/gpu/drm/i915/intel_dp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +2 -2
index 64c7578..92415f4 100644
@@ -4317,8 +4317,6 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
 	struct intel_dp *intel_dp = &intel_dig_port->dp;
 
 	drm_dp_aux_unregister(&intel_dp->aux);
-	intel_dp_mst_encoder_cleanup(intel_dig_port);
-	drm_encoder_cleanup(encoder);
 	if (is_edp(intel_dp)) {
 		cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
 		/*
@@ -4334,6 +4332,8 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
 			intel_dp->edp_notifier.notifier_call = NULL;
 		}
 	}
+	intel_dp_mst_encoder_cleanup(intel_dig_port);
+	drm_encoder_cleanup(encoder);
 	kfree(intel_dig_port);
 }
 
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx