提交 0f0252d7 编写于 作者: B Brian Norris 提交者: Zheng Zengkai

drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure

stable inclusion
from stable-v5.10.94
commit b01b7b868479f00e4f9b570cdb222d0a021ab719
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b01b7b868479f00e4f9b570cdb222d0a021ab719

--------------------------------

[ Upstream commit 5f31dbea ]

If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't
ready), we leave a dangling drm_panel reference to freed memory. Clean
that up on failure.

Fixes: 2a994cbe ("drm/panel: Add Kingdisplay KD097D04 panel driver")
Signed-off-by: NBrian Norris <briannorris@chromium.org>
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.1.Icb4d9dbc1817f4e826361a4f1cea7461541668f0@changeidSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 bd9f67a4
......@@ -406,7 +406,13 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)
if (err < 0)
return err;
return mipi_dsi_attach(dsi);
err = mipi_dsi_attach(dsi);
if (err < 0) {
kingdisplay_panel_del(kingdisplay);
return err;
}
return 0;
}
static int kingdisplay_panel_remove(struct mipi_dsi_device *dsi)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册