提交 1c14b179 编写于 作者: C Christophe JAILLET 提交者: Zheng Zengkai

media: venus: core: Fix a potential NULL pointer dereference in an error handling path

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

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

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

[ Upstream commit e4debea9 ]

The normal path of the function makes the assumption that
'pm_ops->core_power' may be NULL.
We should make the same assumption in the error handling path or a NULL
pointer dereference may occur.

Add the missing test before calling 'pm_ops->core_power'

Fixes: 9e8efdb5 ("media: venus: core: vote for video-mem path")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 d01ff67e
...@@ -409,6 +409,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) ...@@ -409,6 +409,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
err_video_path: err_video_path:
icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0);
err_cpucfg_path: err_cpucfg_path:
if (pm_ops->core_power)
pm_ops->core_power(core, POWER_ON); pm_ops->core_power(core, POWER_ON);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册