Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] slimbus: qcom-ngd-ctrl: put the child platform device on unregister
@ 2026-11-04  2:14 Wentao Liang
  2026-11-04  7:13 ` Krzysztof Kozlowski
  2026-11-24 21:52 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-04  2:14 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-arm-msm, linux-sound

qcom_slim_ngd_unregister() only takes the child device out of the device
hierarchy with platform_device_del().  That leaves the reference taken
by platform_device_alloc() in of_qcom_slim_ngd_register() behind, so the
child platform device, the resources attached to it and the reference it
holds on its parent leak on every controller removal and on the probe
error path.

Use platform_device_unregister(), which also puts the reference.

Fixes: 8663e8334d7b ("slimbus: qcom-ngd-ctrl: Fix up platform_driver registration")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 9bee4b376877..9f24fcc5f0e0 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1641,7 +1641,7 @@ static void qcom_slim_ngd_unregister(struct qcom_slim_ngd_ctrl *ctrl)
 {
 	struct qcom_slim_ngd *ngd = ctrl->ngd;
 
-	platform_device_del(ngd->pdev);
+	platform_device_unregister(ngd->pdev);
 }
 
 static int qcom_slim_ngd_probe(struct platform_device *pdev)
-- 
2.34.1


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

end of thread, other threads:[~2026-11-24 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:14 [PATCH] slimbus: qcom-ngd-ctrl: put the child platform device on unregister Wentao Liang
2026-11-04  7:13 ` Krzysztof Kozlowski
2026-11-24 21:52 ` Srinivas Kandagatla

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