From 107228517654a49aff48626885e7c89d0a96e4d7 Mon Sep 17 00:00:00 2001 From: wlf Date: Mon, 30 Jun 2014 17:01:12 +0800 Subject: [PATCH] USB: fix DWC_OTG HCD disconnect bug to avoid NULL pointer. --- drivers/usb/dwc_otg_310/dwc_otg_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.34.1