usb: gadget: atmel_usba: always test udc->driver
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Tue, 6 May 2014 15:16:07 +0000 (17:16 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 14 May 2014 14:23:26 +0000 (09:23 -0500)
commitbcdbc084ebab447f6eb1add7b953f125b0c8174b
treedb0bf0f104402ab0d436312cd124fccb1bfa4dd9
parent4d9f872ced245ef0c712f0f04adf446d37813c57
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>
drivers/usb/gadget/atmel_usba_udc.c