All of lore.kernel.org
 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
  0 siblings, 1 reply; 2+ 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] 2+ messages in thread

* Re: [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
  2026-11-03  1:44 [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code Xiangwu Lai
@ 2026-11-03  1:50 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-03  1:50 UTC (permalink / raw)
  To: Xiangwu Lai; +Cc: linux-usb

> 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>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103014457.1255-1-laixiangwu@cmss.chinamobile.com?part=1


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

end of thread, other threads:[~2026-11-03  1:50 UTC | newest]

Thread overview: 2+ 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.