* [PATCH] usb: chipidea: npcm: keep the ci_hdrc platform device for removal
@ 2026-11-04 2:14 Wentao Liang
2026-11-04 2:24 ` sashiko-bot
2026-11-04 8:14 ` Peter Chen
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-04 2:14 UTC (permalink / raw)
To: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry,
Patrick Venture, Nancy Yuen, Benjamin Fair, Peter Chen,
Greg Kroah-Hartman
Cc: openbmc, linux-usb
npcm_udc_probe() creates the ci_hdrc platform device with
ci_hdrc_add_device() and stores it only in the local plat_ci variable.
The npcm_udc_data::ci field that npcm_udc_remove() passes to
ci_hdrc_remove_device() is never assigned, so it stays NULL.
ci_hdrc_remove_device() therefore never unregisters the device created
during probe. Both the platform device and the reference it holds on
its parent are leaked on every unbind, and the UDC core structures are
never torn down.
Store the returned device in ci->ci.
Fixes: 70f13579c2f7 ("usb: chipidea: Add support for NPCM")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/usb/chipidea/ci_hdrc_npcm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_npcm.c b/drivers/usb/chipidea/ci_hdrc_npcm.c
index e52a2b05cbe2..8ad8797742f1 100644
--- a/drivers/usb/chipidea/ci_hdrc_npcm.c
+++ b/drivers/usb/chipidea/ci_hdrc_npcm.c
@@ -70,6 +70,8 @@ static int npcm_udc_probe(struct platform_device *pdev)
goto clk_err;
}
+ ci->ci = plat_ci;
+
pm_runtime_no_callbacks(dev);
pm_runtime_enable(dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: chipidea: npcm: keep the ci_hdrc platform device for removal
2026-11-04 2:14 [PATCH] usb: chipidea: npcm: keep the ci_hdrc platform device for removal Wentao Liang
@ 2026-11-04 2:24 ` sashiko-bot
2026-11-04 8:14 ` Peter Chen
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-04 2:24 UTC (permalink / raw)
To: Wentao Liang; +Cc: linux-usb
> npcm_udc_probe() creates the ci_hdrc platform device with
> ci_hdrc_add_device() and stores it only in the local plat_ci variable.
> The npcm_udc_data::ci field that npcm_udc_remove() passes to
> ci_hdrc_remove_device() is never assigned, so it stays NULL.
>
> ci_hdrc_remove_device() therefore never unregisters the device created
> during probe. Both the platform device and the reference it holds on
> its parent are leaked on every unbind, and the UDC core structures are
> never torn down.
>
> Store the returned device in ci->ci.
>
> Fixes: 70f13579c2f7 ("usb: chipidea: Add support for NPCM")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104021456.1468462-1-vulab@iscas.ac.cn?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: chipidea: npcm: keep the ci_hdrc platform device for removal
2026-11-04 2:14 [PATCH] usb: chipidea: npcm: keep the ci_hdrc platform device for removal Wentao Liang
2026-11-04 2:24 ` sashiko-bot
@ 2026-11-04 8:14 ` Peter Chen
1 sibling, 0 replies; 3+ messages in thread
From: Peter Chen @ 2026-11-04 8:14 UTC (permalink / raw)
To: Wentao Liang
Cc: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry,
Patrick Venture, Nancy Yuen, Benjamin Fair, Peter Chen,
Greg Kroah-Hartman, openbmc, linux-usb
On 26-11-04 02:14:56, Wentao Liang wrote:
> npcm_udc_probe() creates the ci_hdrc platform device with
> ci_hdrc_add_device() and stores it only in the local plat_ci variable.
> The npcm_udc_data::ci field that npcm_udc_remove() passes to
> ci_hdrc_remove_device() is never assigned, so it stays NULL.
>
> ci_hdrc_remove_device() therefore never unregisters the device created
> during probe. Both the platform device and the reference it holds on
> its parent are leaked on every unbind, and the UDC core structures are
> never torn down.
>
> Store the returned device in ci->ci.
>
> Fixes: 70f13579c2f7 ("usb: chipidea: Add support for NPCM")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Acked-by: Peter Chen <peter.chen@kernel.org>
Peter
> ---
> drivers/usb/chipidea/ci_hdrc_npcm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_npcm.c b/drivers/usb/chipidea/ci_hdrc_npcm.c
> index e52a2b05cbe2..8ad8797742f1 100644
> --- a/drivers/usb/chipidea/ci_hdrc_npcm.c
> +++ b/drivers/usb/chipidea/ci_hdrc_npcm.c
> @@ -70,6 +70,8 @@ static int npcm_udc_probe(struct platform_device *pdev)
> goto clk_err;
> }
>
> + ci->ci = plat_ci;
> +
> pm_runtime_no_callbacks(dev);
> pm_runtime_enable(dev);
>
> --
> 2.34.1
>
>
--
Thanks,
Peter Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 8:14 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] usb: chipidea: npcm: keep the ci_hdrc platform device for removal Wentao Liang
2026-11-04 2:24 ` sashiko-bot
2026-11-04 8:14 ` Peter Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox