* [PATCH] media: venus: core: Fix a potential NULL pointer dereference in an error handling path
@ 2021-08-12 5:14 Christophe JAILLET
2021-11-11 15:17 ` Christophe JAILLET
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-08-12 5:14 UTC (permalink / raw)
To: stanimir.varbanov, agross, bjorn.andersson, mchehab, mansur, swboyd
Cc: linux-media, linux-arm-msm, linux-kernel, kernel-janitors,
Christophe JAILLET
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: 9e8efdb57879 ("media: venus: core: vote for video-mem path")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/media/platform/qcom/venus/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 91b15842c555..84cd92628cfd 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -472,7 +472,8 @@ 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:
- pm_ops->core_power(core, POWER_ON);
+ if (pm_ops->core_power)
+ pm_ops->core_power(core, POWER_ON);
return ret;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: venus: core: Fix a potential NULL pointer dereference in an error handling path
2021-08-12 5:14 [PATCH] media: venus: core: Fix a potential NULL pointer dereference in an error handling path Christophe JAILLET
@ 2021-11-11 15:17 ` Christophe JAILLET
0 siblings, 0 replies; 2+ messages in thread
From: Christophe JAILLET @ 2021-11-11 15:17 UTC (permalink / raw)
To: stanimir.varbanov, agross, bjorn.andersson, mchehab, mansur, swboyd
Cc: linux-media, linux-arm-msm, linux-kernel, kernel-janitors
Le 12/08/2021 à 07:14, Christophe JAILLET a écrit :
> 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: 9e8efdb57879 ("media: venus: core: vote for video-mem path")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/media/platform/qcom/venus/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 91b15842c555..84cd92628cfd 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -472,7 +472,8 @@ 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:
> - pm_ops->core_power(core, POWER_ON);
> + if (pm_ops->core_power)
> + pm_ops->core_power(core, POWER_ON);
>
> return ret;
> }
>
Hi,
this was sent duing the summer holidays. Since then, a few other patches
have been merged in linux-next for this file.
So, this is a polite reminder.
CJ
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-11 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 5:14 [PATCH] media: venus: core: Fix a potential NULL pointer dereference in an error handling path Christophe JAILLET
2021-11-11 15:17 ` Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).