From: wlf Date: Mon, 30 Jun 2014 09:01:12 +0000 (+0800) Subject: USB: fix DWC_OTG HCD disconnect bug to avoid NULL pointer. X-Git-Tag: firefly_0821_release~5021 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=107228517654a49aff48626885e7c89d0a96e4d7;p=firefly-linux-kernel-4.4.55.git USB: fix DWC_OTG HCD disconnect bug to avoid NULL pointer. --- diff --git a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c index 825c14d28373..13f76b4664c9 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c @@ -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; }