summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2021-09-24 03:33:55 +0300
committerSam Ravnborg <sam@ravnborg.org>2021-10-14 22:55:12 +0300
commit9bf7123bb07f98dc76acb5daa91248e6f95713cb (patch)
treea4a8df3c8b4490a98236738ed47f4d2541dc9f39 /drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
parent32a267e9c057e1636e7afdd20599aa5741a73079 (diff)
downloadlinux-9bf7123bb07f98dc76acb5daa91248e6f95713cb.tar.xz
drm/panel: Delete panel on mipi_dsi_attach() failure
Many DSI panel drivers fail to clean up their panel references on mipi_dsi_attach() failure, so we're leaving a dangling drm_panel reference to freed memory. Clean that up on failure. Noticed by inspection, after seeing similar problems on other drivers. Therefore, I'm not marking Fixes/stable. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.3.If9e74fa9b1d6eaa9e0e5b95b2b957b992740251c@changeid
Diffstat (limited to 'drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c')
-rw-r--r--drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
index 3c20beeb1781..3991f5d950af 100644
--- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
+++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
@@ -241,7 +241,13 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)
if (ret < 0)
return ret;
- return mipi_dsi_attach(dsi);
+ ret = mipi_dsi_attach(dsi);
+ if (ret < 0) {
+ wuxga_nt_panel_del(wuxga_nt);
+ return ret;
+ }
+
+ return 0;
}
static int wuxga_nt_panel_remove(struct mipi_dsi_device *dsi)