DORMANTno replies REVIEWED: 16 (16M)

2 review trailers (1 from subsystem maintainers).

[PATCH v4] usb: chipidea: ci_hdrc_imx: Fix error handling when creating IRQ name

From: <hidden>
Date: 2026-09-11 05:11:06
Also in: imx, linux-usb, lkml
Subsystem: chipidea usb high speed dual role controller, the rest, usb subsystem · Maintainers: Peter Chen, Linus Torvalds, Greg Kroah-Hartman

From: bui duc phuc <redacted>

devm_kasprintf() can fail when allocating the wakeup IRQ name. In this
case, the probe error path should shut down the PHY before returning.

Use the phy_shutdown error path instead of err_clk so that the PHY is
properly shut down when creating the IRQ name or requesting the wakeup
IRQ fails.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Reported-by: Sashiko Bot <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/all/20260806065755.C9F361F000E9@smtp.kernel.org/ (local)
Signed-off-by: bui duc phuc <redacted>
---

Link v2:
https://lore.kernel.org/all/20260807065619.30604-2-phucduc.bui@gmail.com/ (local)
Link v3:
https://lore.kernel.org/all/20260810093112.47807-2-phucduc.bui@gmail.com/ (local)

Changes in v3:
 - Use the phy_shutdown label instead of err_clk as suggested by
   Sashiko's review.
 - Add Peter Chen's Acked-by tag.
 - Add Frank Li's Reviewed-by tag.
Changes in v4:
 - Rebased on top of gregkh/usb-testing.
 - The ret assignment for dev_err_probe() is already handled by
   1db5c6b0b983 ("usb: chipidea: imx: fix missing ret assignment for
   dev_err_probe").
 - Keep this patch focused on the phy_shutdown error path.

 drivers/usb/chipidea/ci_hdrc_imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 6a17b22047b3..edbf9df9b8f2 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -533,7 +533,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 		irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", pdata.name);
 		if (!irq_name) {
 			ret = dev_err_probe(dev, -ENOMEM, "failed to create irq_name\n");
-			goto err_clk;
+			goto phy_shutdown;
 		}
 
 		ret = devm_request_threaded_irq(dev, data->wakeup_irq,
@@ -541,7 +541,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 						IRQF_ONESHOT | IRQF_NO_AUTOEN,
 						irq_name, data);
 		if (ret)
-			goto err_clk;
+			goto phy_shutdown;
 	}
 
 	ret = imx_usbmisc_init(data->usbmisc_data);
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help