9
0
Fork 0

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:
Sascha Hauer 2014-02-13 10:29:20 +01:00
parent 4435836ec2
commit 771109df46
1 changed files with 3 additions and 0 deletions

View File

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