When there is no udc registered bail out in usb_gadget_poll instead of crashing the system. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/usb/gadget/fsl_udc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c index 993c7eb..50bae78 100644 --- a/drivers/usb/gadget/fsl_udc.c +++ b/drivers/usb/gadget/fsl_udc.c @@ -1938,6 +1938,9 @@ int usb_gadget_poll(void) u32 irq_src; int status = 0; + if (!udc) + return -ENODEV; + /* Disable ISR for OTG host mode */ if (udc->stopped) return -EIO; -- 1.8.5.3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox