Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
@ 2026-11-03  1:44 Xiangwu Lai
  2026-11-03  1:50 ` sashiko-bot
  2026-11-17  1:14 ` Xiangwu Lai
  0 siblings, 2 replies; 4+ messages in thread
From: Xiangwu Lai @ 2026-11-03  1:44 UTC (permalink / raw)
  To: Kevin Cernekee, Neill Kapron, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Xiangwu Lai

bcm63xx_init_udc_hw() calls iudma_init() and stores the return code
in rc, but then returns 0 unconditionally.  When iudma_init() fails,
the hardware has already been torn down by bcm63xx_uninit_udc_hw(),
yet the probe believes initialization succeeded and goes on to
register a gadget controller with non-functional IUDMA channels.

Return rc so the probe fails and reports the real error.

Fixes: 613065e53cb1 ("usb: gadget: bcm63xx UDC driver")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
 drivers/usb/gadget/udc/bcm63xx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index ba91b1ebb..250bb7685 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -1012,7 +1012,7 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc)
 	if (rc)
 		bcm63xx_uninit_udc_hw(udc);
 
-	return 0;
+	return rc;
 }
 
 /***********************************************************************



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

end of thread, other threads:[~2026-11-17  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03  1:44 [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code Xiangwu Lai
2026-11-03  1:50 ` sashiko-bot
2026-11-17  1:14 ` Xiangwu Lai
2026-11-17  5:26   ` Greg Kroah-Hartman

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