USB gadget: fsl: Bail out if no udc exists
When there is no udc registered bail out in usb_gadget_poll instead of crashing the system. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
4435836ec2
commit
771109df46
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue