* [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
@ 2020-11-25 5:42 Bjorn Andersson
2020-11-25 9:58 ` Srinivas Kandagatla
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Andersson @ 2020-11-25 5:42 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Srinivas Kandagatla
Cc: Greg Kroah-Hartman, Vinod Koul, linux-arm-msm, alsa-devel, linux-kernel
Attempting to send a power request during PM operations, when the QMI
handle isn't initialized results in a NULL pointer dereference. So check
if the QMI handle has been initialized before attempting to post the
power requests.
Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/slimbus/qcom-ngd-ctrl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index d8decb345e9d..c502e9e93965 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1229,6 +1229,9 @@ static int qcom_slim_ngd_runtime_resume(struct device *dev)
struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev);
int ret = 0;
+ if (!ctrl->qmi.handle)
+ return 0;
+
if (ctrl->state >= QCOM_SLIM_NGD_CTRL_ASLEEP)
ret = qcom_slim_ngd_power_up(ctrl);
if (ret) {
@@ -1616,6 +1619,9 @@ static int __maybe_unused qcom_slim_ngd_runtime_suspend(struct device *dev)
struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev);
int ret = 0;
+ if (!ctrl->qmi.handle)
+ return 0;
+
ret = qcom_slim_qmi_power_request(ctrl, false);
if (ret && ret != -EBUSY)
dev_info(ctrl->dev, "slim resource not idle:%d\n", ret);
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
2020-11-25 5:42 [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI Bjorn Andersson
@ 2020-11-25 9:58 ` Srinivas Kandagatla
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2020-11-25 9:58 UTC (permalink / raw)
To: Bjorn Andersson, Andy Gross
Cc: Greg Kroah-Hartman, Vinod Koul, linux-arm-msm, alsa-devel, linux-kernel
On 25/11/2020 05:42, Bjorn Andersson wrote:
> Attempting to send a power request during PM operations, when the QMI
> handle isn't initialized results in a NULL pointer dereference. So check
> if the QMI handle has been initialized before attempting to post the
> power requests.
>
> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Applied thanks,
--srini
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
2020-11-25 5:42 [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI Bjorn Andersson
2020-11-25 9:58 ` Srinivas Kandagatla
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: linux-arm-msm
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
On Tue, 24 Nov 2020 21:42:55 -0800 you wrote:
> Attempting to send a power request during PM operations, when the QMI
> handle isn't initialized results in a NULL pointer dereference. So check
> if the QMI handle has been initialized before attempting to post the
> power requests.
>
> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>
> [...]
Here is the summary with links:
- slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
https://git.kernel.org/qcom/c/39014ce6d602
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-29 20:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 5:42 [PATCH] slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI Bjorn Andersson
2020-11-25 9:58 ` Srinivas Kandagatla
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
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).