提交 e4debea9 编写于 作者: C Christophe JAILLET 提交者: Mauro Carvalho Chehab

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

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>
上级 91f2b7d2
...@@ -473,7 +473,8 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) ...@@ -473,7 +473,8 @@ 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:
pm_ops->core_power(core, POWER_ON); if (pm_ops->core_power)
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.
先完成此消息的编辑!
想要评论请 注册