drm/sti: do not remove the drm_bridge that was never added
authorPeter Rosin <peda@axentia.se>
Mon, 6 Aug 2018 06:19:09 +0000 (08:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:46:03 +0000 (14:46 +0100)
[ Upstream commit 66e31a72dc38543b2d9d1ce267dc78ba9beebcfd ]

Removing the drm_bridge_remove call should avoid a NULL dereference
during list processing in drm_bridge_remove if the error path is ever
taken.

The more natural approach would perhaps be to add a drm_bridge_add,
but there are several other bridges that never call drm_bridge_add.
Just removing the drm_bridge_remove is the easier fix.

Fixes: 84601dbdea36 ("drm: sti: rework init sequence")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180806061910.29914-2-peda@axentia.se
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/sti/sti_hda.c
drivers/gpu/drm/sti/sti_hdmi.c

index cf65e32b5090a00991e06a583a31214b951a8eff..0399bb18d3872b7adad83de601e099d6dd6f8eac 100644 (file)
@@ -721,7 +721,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
        return 0;
 
 err_sysfs:
-       drm_bridge_remove(bridge);
        return -EINVAL;
 }
 
index 30f02d2fdd034ccffc89fa95aa8d94ff5edecb5e..bbb195a92e93f3648302f2aee55ad04a81cea6e8 100644 (file)
@@ -1314,7 +1314,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
        return 0;
 
 err_sysfs:
-       drm_bridge_remove(bridge);
        hdmi->drm_connector = NULL;
        return -EINVAL;
 }