usb: musb: Check for NULL pointers when no OTG transceiver used
PATCH 1/1 usb: musb: Check for NULL pointers when no OTG transceiver used
Add checks to prevent NULL pointer exception in case no OTG transceiver has been selected. i.e. musb->xceiv == NULL
Signed-off-by Roger Quadros <[email protected]>
--- drivers/usb/musb/musb_core.c | 3 ++- drivers/usb/musb/omap2430.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/usb/musb/musb_core.c +2 -1
@@ -1861,7 +1861,8 @@ static void musb_free(struct musb *musb) }#ifdef CONFIG_USB_MUSB_OTG -put_device (musb->xceiv->dev); +if (musb->xceiv) +put_device (musb->xceiv->dev);#endif #ifdef CONFIG_USB_MUSB_HDRC_HCD
drivers/usb/musb/omap2430.c +5 -2
@@ -312,9 +312,12 @@ int musb_platform_exit(struct musb *musb)omap_vbus_power (musb,0 /*off*/ ,1 ); -musb_platform_suspend (musb); +if (musb->xceiv) +musb_platform_suspend (musb); + +if (musb->clock) +clk_put (musb->clock); -clk_put (musb->clock); musb->clock =0 ;return 0 ;
Signature · 1 line
1.6.0.4