提交 82e3471b 编写于 作者: L Liviu Dudau 提交者: Zheng Zengkai

drm/komeda: return early if drm_universal_plane_init() fails.

stable inclusion
from stable-v5.10.121
commit c977d63b8cc45a1ca4ce438c072af43af6f4aa6b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

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

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

[ Upstream commit c8f76c37 ]

If drm_universal_plane_init() fails early we jump to the common cleanup code
that calls komeda_plane_destroy() which in turn could access the uninitalised
drm_plane and crash. Return early if an error is detected without going through
the common code.
Reported-by: NSteven Price <steven.price@arm.com>
Reviewed-by: NSteven Price <steven.price@arm.com>
Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 3e9fde04
...@@ -274,8 +274,10 @@ static int komeda_plane_add(struct komeda_kms_dev *kms, ...@@ -274,8 +274,10 @@ static int komeda_plane_add(struct komeda_kms_dev *kms,
komeda_put_fourcc_list(formats); komeda_put_fourcc_list(formats);
if (err) if (err) {
goto cleanup; kfree(kplane);
return err;
}
drm_plane_helper_add(plane, &komeda_plane_helper_funcs); drm_plane_helper_add(plane, &komeda_plane_helper_funcs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册