From: Lyude Paul Date: Fri, 11 Jan 2019 00:53:35 +0000 (-0500) Subject: drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector() X-Git-Tag: Ubuntu-5.10.0-12.13~5868^2~23^2~58 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=013240935d4e9a7b62e876f20b45944fc2e58986;p=mirror_ubuntu-hirsute-kernel.git drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector() 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 Reviewed-by: Ben Skeggs Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-13-lyude@redhat.com --- diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index f36146d4d9b7..d173cdd6ee3f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1091,11 +1091,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; }