[PATCH v3 2/2] usb: chipidea: ci_hdrc_imx: Fix error handling when creating IRQ name

phucduc.bui at gmail.com phucduc.bui at gmail.com
Mon Aug 10 02:31:12 PDT 2026


From: bui duc phuc <phucduc.bui at gmail.com>

devm_kasprintf() can fail when allocating the wakeup IRQ name. The error
was logged with dev_err_probe(), but its return value was ignored and
probe could continue with a successful return value.

Store the error returned by dev_err_probe() in ret and jump to the error
path to propagate the failure.

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

Link v2: 
https://lore.kernel.org/all/20260807065619.30604-2-phucduc.bui@gmail.com/
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.

 drivers/usb/chipidea/ci_hdrc_imx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 9e529398c607..edbf9df9b8f2 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -532,8 +532,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 	if (data->wakeup_irq > 0) {
 		irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", pdata.name);
 		if (!irq_name) {
-			dev_err_probe(dev, -ENOMEM, "failed to create irq_name\n");
-			goto err_clk;
+			ret = dev_err_probe(dev, -ENOMEM, "failed to create irq_name\n");
+			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




More information about the linux-arm-kernel mailing list