Commit e4debea9 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mauro Carvalho Chehab
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 91f2b7d2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -473,6 +473,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
err_video_path:
	icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0);
err_cpucfg_path:
	if (pm_ops->core_power)
		pm_ops->core_power(core, POWER_ON);

	return ret;