From: Dave Stevenson Date: Thu, 31 Mar 2022 11:03:36 +0000 (+0100) Subject: drm/panel: ilitek-ili9881c: Clean up on mipi_dsi_attach failure X-Git-Tag: accepted/tizen/unified/20240422.153132~619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b00639c7a2badc8f4e64ac5ffa558357eea34ea;p=platform%2Fkernel%2Flinux-rpi.git drm/panel: ilitek-ili9881c: Clean up on mipi_dsi_attach failure mipi_dsi_attach is allowed to fail, and currently the probe code doesn't clean up (mainly drm_panel_remove) if this happens. Add cleanup code on failure. Signed-off-by: Dave Stevenson --- diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index aaaf354..e4e3cbb 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -1345,7 +1345,11 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = MIPI_DSI_FMT_RGB888; dsi->lanes = 4; - return mipi_dsi_attach(dsi); + ret = mipi_dsi_attach(dsi); + if (ret) + drm_panel_remove(&ctx->panel); + + return ret; } static void ili9881c_dsi_remove(struct mipi_dsi_device *dsi)