mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
[ Upstream commitc62102165d
] In case mipi_dsi_attach() fails, call drm_panel_remove() to avoid memory leak. Fixes:849b2e3ff9
("drm/panel: Add Sitronix ST7701 panel driver") Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20221014231106.468063-1-marex@denx.de Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8363f5d71a
commit
24fef64873
1 changed files with 9 additions and 1 deletions
|
@ -384,7 +384,15 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
|
|||
st7701->dsi = dsi;
|
||||
st7701->desc = desc;
|
||||
|
||||
return mipi_dsi_attach(dsi);
|
||||
ret = mipi_dsi_attach(dsi);
|
||||
if (ret)
|
||||
goto err_attach;
|
||||
|
||||
return 0;
|
||||
|
||||
err_attach:
|
||||
drm_panel_remove(&st7701->panel);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int st7701_dsi_remove(struct mipi_dsi_device *dsi)
|
||||
|
|
Loading…
Add table
Reference in a new issue