USB: pxa27x_udc - Fix Oops

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>
This commit is contained in:
karl beldan 2008-05-16 11:30:22 +02:00 committed by Greg Kroah-Hartman
parent 1b2d23d49c
commit 3f88662074

View 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);
}
/**