[<prev] [next>] [day] [month] [year] [list]
Message-Id: <2235101c73ad1137685a8669bfab9a86d2bd9ec7.1632116708.git.christophe.jaillet@wanadoo.fr>
Date: Mon, 20 Sep 2021 07:46:43 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: stanimir.varbanov@...aro.org, agross@...nel.org,
bjorn.andersson@...aro.org, mchehab@...nel.org,
mansur@...eaurora.org, swboyd@...omium.org
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] media: venus: core: Fix a potential NULL pointer dereference
According to the code in 'venus_runtime_suspend()' and
'venus_runtime_resume()', 'pm_ops->core_power' can be NULL.
So make the same assumption in the error handling path of
'venus_runtime_suspend()' and add the missing check. This can avoid a
potential NULL pointer dereference.
Fixes: 9e8efdb57879 ("media: venus: core: vote for video-mem path")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.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 7e54c5d571dc..593d4cbe44e0 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -470,7 +470,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
Powered by blists - more mailing lists