summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-05-06 19:16:07 +0400
committerFelipe Balbi <balbi@ti.com>2014-05-14 18:23:26 +0400
commitbcdbc084ebab447f6eb1add7b953f125b0c8174b (patch)
treedb0bf0f104402ab0d436312cd124fccb1bfa4dd9 /drivers/usb/gadget
parent4d9f872ced245ef0c712f0f04adf446d37813c57 (diff)
downloadlinux-bcdbc084ebab447f6eb1add7b953f125b0c8174b.tar.xz
usb: gadget: atmel_usba: always test udc->driver
Found using smatch: drivers/usb/gadget/atmel_usba_udc.c:1689 usba_udc_irq() error: we previously assumed 'udc->driver' could be null (see line 1636) Always test udc->driver before using its members. Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 9f65324f9ae0..76023ce449a3 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1686,7 +1686,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
reset_all_endpoints(udc);
if (udc->gadget.speed != USB_SPEED_UNKNOWN
- && udc->driver->disconnect) {
+ && udc->driver && udc->driver->disconnect) {
udc->gadget.speed = USB_SPEED_UNKNOWN;
spin_unlock(&udc->lock);
udc->driver->disconnect(&udc->gadget);