USB: fix DWC_OTG HCD disconnect bug to avoid NULL pointer.
authorwlf <wulf@rock-chips.com>
Mon, 30 Jun 2014 09:01:12 +0000 (17:01 +0800)
committerwlf <wulf@rock-chips.com>
Mon, 30 Jun 2014 09:01:12 +0000 (17:01 +0800)
drivers/usb/dwc_otg_310/dwc_otg_hcd.c

index 825c14d283732840544cb7c6195a5feb0c20adbc..13f76b4664c9daea188c4407de381e332e3be908 100755 (executable)
@@ -286,8 +286,8 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p)
        /* In some case, we don't disconnect a usb device, but
         * disconnect intr was triggered, so check hprt0 here. */
        if ((!hprt0.b.prtenchng)
-           && (hprt0.d32 != 0x1000)
-           && (hprt0.d32 != 0x1100)) {
+           && (!hprt0.b.prtconndet)
+           && hprt0.b.prtconnsts) {
                DWC_PRINTF("%s: hprt0 = 0x%08x\n", __func__, hprt0.d32);
                return 1;
        }