diff mbox series

remoteproc: qcom: fix reference leak in adsp_start

Message ID 20201102143534.144484-1-zhangqilong3@huawei.com (mailing list archive)
State Accepted
Commit 00293e662ccafa33116ff9132ca1ded1c422f081
Headers show
Series remoteproc: qcom: fix reference leak in adsp_start | expand

Commit Message

Zhang Qilong Nov. 2, 2020, 2:35 p.m. UTC
pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in adsp_start, so we should fix it.

Fixes: dc160e4491222 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/remoteproc/qcom_q6v5_adsp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

patchwork-bot+linux-remoteproc@kernel.org Nov. 18, 2020, 2:30 p.m. UTC | #1
Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

On Mon, 2 Nov 2020 22:35:34 +0800 you wrote:
> pm_runtime_get_sync will increment pm usage counter even it
> failed. Forgetting to pm_runtime_put_noidle will result in
> reference leak in adsp_start, so we should fix it.
> 
> Fixes: dc160e4491222 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> 
> [...]

Here is the summary with links:
  - remoteproc: qcom: fix reference leak in adsp_start
    https://git.kernel.org/andersson/remoteproc/c/00293e662cca

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index efb2c1aa80a3..f0b7363b5b26 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -193,8 +193,10 @@  static int adsp_start(struct rproc *rproc)
 
 	dev_pm_genpd_set_performance_state(adsp->dev, INT_MAX);
 	ret = pm_runtime_get_sync(adsp->dev);
-	if (ret)
+	if (ret) {
+		pm_runtime_put_noidle(adsp->dev);
 		goto disable_xo_clk;
+	}
 
 	ret = clk_bulk_prepare_enable(adsp->num_clks, adsp->clks);
 	if (ret) {