Trying to destroy the connector using mstc->connector.funcs->destroy()
if connector initialization fails is wrong: there is no possible
codepath in nv50_mstc_new where nv50_mstm_add_connector() would return
<0 and mstc would be non-NULL.

Signed-off-by: Lyude Paul <ly...@redhat.com>
Cc: Daniel Vetter <dan...@ffwll.ch>
Cc: David Airlie <airl...@redhat.com>
Cc: Jerry Zuo <jerry....@amd.com>
Cc: Harry Wentland <harry.wentl...@amd.com>
Cc: Juston Li <juston...@intel.com>
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c 
b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 26af45785939..641252208e67 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1099,11 +1099,8 @@ nv50_mstm_add_connector(struct drm_dp_mst_topology_mgr 
*mgr,
        int ret;
 
        ret = nv50_mstc_new(mstm, port, path, &mstc);
-       if (ret) {
-               if (mstc)
-                       mstc->connector.funcs->destroy(&mstc->connector);
+       if (ret)
                return NULL;
-       }
 
        return &mstc->connector;
 }
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to