]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: pxa27x_udc - Fix Oops
authorkarl beldan <karl.beldan@gmail.com>
Fri, 16 May 2008 09:30:22 +0000 (11:30 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 20 May 2008 21:14:14 +0000 (14:14 -0700)
udc_disable oopses dereferencing udc_command.

Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
Acked-by: Robert Jarzmik <rjarzmik@free.fr>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/pxa27x_udc.c

index 499b7a23f351275b0f55fc420f50f029fadcc515..e02bfd4df3a62cf0105927864663b13d952ca8be 100644 (file)
@@ -1526,7 +1526,8 @@ static void udc_disable(struct pxa_udc *udc)
 
        ep0_idle(udc);
        udc->gadget.speed = USB_SPEED_UNKNOWN;
-       udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
+       if (udc->mach->udc_command)
+               udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
 }
 
 /**