summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2021-09-23 17:33:55 -0700
committerSam Ravnborg <sam@ravnborg.org>2021-10-14 21:55:12 +0200
commit9bf7123bb07f98dc76acb5daa91248e6f95713cb (patch)
treea4a8df3c8b4490a98236738ed47f4d2541dc9f39 /drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
parent32a267e9c057e1636e7afdd20599aa5741a73079 (diff)
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-sharp-ls043t1le01.c')
-rw-r--r--drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
index b937e24dac8e..25829a0a8e80 100644
--- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
+++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
@@ -296,7 +296,13 @@ static int sharp_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) {
+ sharp_nt_panel_del(sharp_nt);
+ return ret;
+ }
+
+ return 0;
}
static int sharp_nt_panel_remove(struct mipi_dsi_device *dsi)