public inbox for linux-remoteproc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: qcom: fix reference leak in adsp_start
@ 2020-11-02 14:35 Zhang Qilong
  2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Qilong @ 2020-11-02 14:35 UTC (permalink / raw)
  To: agross, bjorn.andersson, ohad; +Cc: linux-arm-msm, linux-remoteproc

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(-)

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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-18 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 14:35 [PATCH] remoteproc: qcom: fix reference leak in adsp_start Zhang Qilong
2020-11-18 14:30 ` patchwork-bot+linux-remoteproc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox