USB: Fix gadget_wrapper NULL pointer bug.
authorwlf <wulf@rock-chips.com>
Tue, 1 Apr 2014 06:29:31 +0000 (14:29 +0800)
committerwlf <wulf@rock-chips.com>
Tue, 1 Apr 2014 06:29:31 +0000 (14:29 +0800)
drivers/usb/dwc_otg_310/dwc_otg_pcd_linux.c

index 756c5c23b0a2813c6d085d0f11a1ffc647b05b5f..443b839339faa1f0a67c0aa8f3dccd8992e1c311 100755 (executable)
@@ -1616,7 +1616,9 @@ int dwc_vbus_status( void )
 {
 #ifdef CONFIG_USB20_OTG
        dwc_otg_pcd_t *pcd = 0;
-       pcd = gadget_wrapper->pcd;
+       if(gadget_wrapper){
+               pcd = gadget_wrapper->pcd;
+       }
 
        if(!pcd)
                return 0;