linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
@ 2025-10-27  6:06 Miaoqian Lin
  2025-10-27 14:39 ` Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Miaoqian Lin @ 2025-10-27  6:06 UTC (permalink / raw)
  To: Srinivas Kandagatla, Vinod Koul, Greg Kroah-Hartman,
	linux-arm-msm, linux-sound, linux-kernel
  Cc: linmq006, stable

The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
internally uses device_find_child() to obtain a device reference.
According to the device_find_child() documentation,
the caller must drop the reference with put_device() after use.

Found via static analysis and this is similar to commit 4e65bda8273c
("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")

Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 4fb66986cc22..cd40ab839c54 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1241,6 +1241,7 @@ static void qcom_slim_ngd_notify_slaves(struct qcom_slim_ngd_ctrl *ctrl)
 
 		if (slim_get_logical_addr(sbdev))
 			dev_err(ctrl->dev, "Failed to get logical address\n");
+		put_device(&sbdev->dev);
 	}
 }
 
-- 
2.39.5 (Apple Git-154)


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

* Re: [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  2025-10-27  6:06 [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves Miaoqian Lin
@ 2025-10-27 14:39 ` Dmitry Baryshkov
  2025-11-10  7:25 ` Srinivas Kandagatla
  2025-11-12  5:13 ` Vinod Koul
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2025-10-27 14:39 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Srinivas Kandagatla, Vinod Koul, Greg Kroah-Hartman,
	linux-arm-msm, linux-sound, linux-kernel, stable

On Mon, Oct 27, 2025 at 02:06:01PM +0800, Miaoqian Lin wrote:
> The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
> internally uses device_find_child() to obtain a device reference.
> According to the device_find_child() documentation,
> the caller must drop the reference with put_device() after use.
> 
> Found via static analysis and this is similar to commit 4e65bda8273c
> ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
> 
> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/slimbus/qcom-ngd-ctrl.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  2025-10-27  6:06 [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves Miaoqian Lin
  2025-10-27 14:39 ` Dmitry Baryshkov
@ 2025-11-10  7:25 ` Srinivas Kandagatla
  2025-11-12  5:13 ` Vinod Koul
  2 siblings, 0 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2025-11-10  7:25 UTC (permalink / raw)
  To: Vinod Koul, Greg Kroah-Hartman, linux-arm-msm, linux-sound,
	linux-kernel, Miaoqian Lin
  Cc: stable


On Mon, 27 Oct 2025 14:06:01 +0800, Miaoqian Lin wrote:
> The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
> internally uses device_find_child() to obtain a device reference.
> According to the device_find_child() documentation,
> the caller must drop the reference with put_device() after use.
> 
> Found via static analysis and this is similar to commit 4e65bda8273c
> ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
> 
> [...]

Applied, thanks!

[1/1] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
      commit: 79d84af332094852614b15638f7ffe18f5f7966e

Best regards,
-- 
Srinivas Kandagatla <srini@kernel.org>


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

* Re: [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  2025-10-27  6:06 [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves Miaoqian Lin
  2025-10-27 14:39 ` Dmitry Baryshkov
  2025-11-10  7:25 ` Srinivas Kandagatla
@ 2025-11-12  5:13 ` Vinod Koul
  2025-11-12 10:09   ` Srinivas Kandagatla
  2 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2025-11-12  5:13 UTC (permalink / raw)
  To: Srinivas Kandagatla, Greg Kroah-Hartman, linux-arm-msm,
	linux-sound, linux-kernel, Miaoqian Lin
  Cc: stable


On Mon, 27 Oct 2025 14:06:01 +0800, Miaoqian Lin wrote:
> The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
> internally uses device_find_child() to obtain a device reference.
> According to the device_find_child() documentation,
> the caller must drop the reference with put_device() after use.
> 
> Found via static analysis and this is similar to commit 4e65bda8273c
> ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
> 
> [...]

Applied, thanks!

[1/1] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
      commit: bcd8db9640bcad313f7fbf8433fcb5459cdd760a

Best regards,
-- 
~Vinod



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

* Re: [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  2025-11-12  5:13 ` Vinod Koul
@ 2025-11-12 10:09   ` Srinivas Kandagatla
  2025-11-12 11:37     ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Srinivas Kandagatla @ 2025-11-12 10:09 UTC (permalink / raw)
  To: Vinod Koul, Srinivas Kandagatla, Greg Kroah-Hartman,
	linux-arm-msm, linux-sound, linux-kernel, Miaoqian Lin
  Cc: stable



On 11/12/25 5:13 AM, Vinod Koul wrote:
> 
> On Mon, 27 Oct 2025 14:06:01 +0800, Miaoqian Lin wrote:
>> The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
>> internally uses device_find_child() to obtain a device reference.
>> According to the device_find_child() documentation,
>> the caller must drop the reference with put_device() after use.
>>
>> Found via static analysis and this is similar to commit 4e65bda8273c
>> ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
>>
>> [...]
> 
> Applied, thanks!

These are slimbus patches? any reason why they are going via soundwire tree?

--srini>
> [1/1] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
>       commit: bcd8db9640bcad313f7fbf8433fcb5459cdd760a
> 
> Best regards,


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

* Re: [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  2025-11-12 10:09   ` Srinivas Kandagatla
@ 2025-11-12 11:37     ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2025-11-12 11:37 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Srinivas Kandagatla, Greg Kroah-Hartman, linux-arm-msm,
	linux-sound, linux-kernel, Miaoqian Lin, stable

On 12-11-25, 10:09, Srinivas Kandagatla wrote:
> 
> 
> On 11/12/25 5:13 AM, Vinod Koul wrote:
> > 
> > On Mon, 27 Oct 2025 14:06:01 +0800, Miaoqian Lin wrote:
> >> The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
> >> internally uses device_find_child() to obtain a device reference.
> >> According to the device_find_child() documentation,
> >> the caller must drop the reference with put_device() after use.
> >>
> >> Found via static analysis and this is similar to commit 4e65bda8273c
> >> ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
> >>
> >> [...]
> > 
> > Applied, thanks!
> 
> These are slimbus patches? any reason why they are going via soundwire tree?

My mistake, sorry :-( dropped now

-- 
~Vinod

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

end of thread, other threads:[~2025-11-12 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27  6:06 [PATCH] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves Miaoqian Lin
2025-10-27 14:39 ` Dmitry Baryshkov
2025-11-10  7:25 ` Srinivas Kandagatla
2025-11-12  5:13 ` Vinod Koul
2025-11-12 10:09   ` Srinivas Kandagatla
2025-11-12 11:37     ` Vinod Koul

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