drm/dp_mst: Fix memory leak in drm_dp_mst_topology_mgr_destroy()
authorLyude Paul <lyude@redhat.com>
Tue, 11 Dec 2018 23:50:26 +0000 (18:50 -0500)
committerLyude Paul <lyude@redhat.com>
Thu, 13 Dec 2018 22:40:49 +0000 (17:40 -0500)
We need to call drm_dp_mst_topology_mgr_set_mst(mgr, false) when
destroying the topology manager in order to ensure that the root mstb
and all of it's descendents are actually destroyed, and additionally to
try to make sure that we leave the hub in a clean state.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181211235026.21758-1-lyude@redhat.com
drivers/gpu/drm/drm_dp_mst_topology.c

index 5a73a0b1c9cd32f348b48693241477e8e485ef48..ad0fb6d003be2920290033c816d25aa7fb707871 100644 (file)
@@ -3235,6 +3235,7 @@ EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init);
  */
 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr)
 {
+       drm_dp_mst_topology_mgr_set_mst(mgr, false);
        flush_work(&mgr->work);
        flush_work(&mgr->destroy_connector_work);
        mutex_lock(&mgr->payload_lock);