From: Srinivas Kandagatla <srini@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>, Srinivas Kandagatla <srini@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH] slimbus: qcom-ngd-ctrl: put the child platform device on unregister
Date: Tue, 24 Nov 2026 21:52:38 +0000 [thread overview]
Message-ID: <fe905aca-2b32-4076-a7b8-949de8b34d5c@kernel.org> (raw)
In-Reply-To: <20261104021427.1468218-1-vulab@iscas.ac.cn>
On 11/4/26 2:14 AM, Wentao Liang wrote:
> 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
Assisted-by is not a valid tag anymore please run checkpatch before
sending the patches.
--srini
> 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)
prev parent reply other threads:[~2026-11-24 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe905aca-2b32-4076-a7b8-949de8b34d5c@kernel.org \
--to=srini@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox