All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get
@ 2022-01-08  9:59 Miaoqian Lin
  2022-01-10 21:12 ` Stephen Boyd
  2022-02-04 18:35 ` (subset) " Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-01-08  9:59 UTC (permalink / raw)
  Cc: linmq006, Andy Gross, Bjorn Andersson, Deepak Kumar Singh,
	Chris Lew, Stephen Boyd, linux-arm-msm, linux-kernel

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling paths.

Fixes: 8c75d585b931 ("soc: qcom: aoss: Expose send for generic usecase")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/soc/qcom/qcom_aoss.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index 34acf58bbb0d..e234d78b33e7 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -451,7 +451,11 @@ struct qmp *qmp_get(struct device *dev)
 
 	qmp = platform_get_drvdata(pdev);
 
-	return qmp ? qmp : ERR_PTR(-EPROBE_DEFER);
+	if (!qmp) {
+		put_device(&pdev->dev);
+		return ERR_PTR(-EPROBE_DEFER);
+	}
+	return qmp;
 }
 EXPORT_SYMBOL(qmp_get);
 
-- 
2.17.1


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

* Re: [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get
  2022-01-08  9:59 [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get Miaoqian Lin
@ 2022-01-10 21:12 ` Stephen Boyd
  2022-02-04 18:35 ` (subset) " Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2022-01-10 21:12 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Andy Gross, Bjorn Andersson, Deepak Kumar Singh, Chris Lew,
	linux-arm-msm, linux-kernel

Quoting Miaoqian Lin (2022-01-08 01:59:31)
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.
> Add the corresponding 'put_device()' in the error handling paths.
>
> Fixes: 8c75d585b931 ("soc: qcom: aoss: Expose send for generic usecase")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

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

* Re: (subset) [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get
  2022-01-08  9:59 [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get Miaoqian Lin
  2022-01-10 21:12 ` Stephen Boyd
@ 2022-02-04 18:35 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2022-02-04 18:35 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chris Lew, linux-kernel, linux-arm-msm, Deepak Kumar Singh,
	Stephen Boyd, Andy Gross

On Sat, 8 Jan 2022 09:59:31 +0000, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.
> Add the corresponding 'put_device()' in the error handling paths.
> 
> 

Applied, thanks!

[1/1] soc: qcom: aoss: Fix missing put_device call in qmp_get
      commit: 4b41a9d0fe3db5f91078a380f62f0572c3ecf2dd

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

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

end of thread, other threads:[~2022-02-04 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08  9:59 [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get Miaoqian Lin
2022-01-10 21:12 ` Stephen Boyd
2022-02-04 18:35 ` (subset) " Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.