usb: dwc_otg: fix a spin-lock error, here should not goto return
authorlyz <lyz@rock-chips.com>
Sun, 18 Jan 2015 15:37:11 +0000 (23:37 +0800)
committerlyz <lyz@rock-chips.com>
Sun, 18 Jan 2015 15:40:08 +0000 (23:40 +0800)
without unlock hck->lock

drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c

index 3a48dc3e52a32bda01f1e2c645260ed07104040d..e9eb036db319349be3ec53a2ef1453bbe57f0581 100755 (executable)
@@ -1136,13 +1136,13 @@ static int urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
        }
 #endif
 
-       DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &flags);
-
        if (((uint32_t) urb & 0xf0000000) == 0) {
                DWC_PRINTF("%s error: urb is %p!!!\n", __func__, urb);
-               goto out1;
+               return 0;
        }
 
+       DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &flags);
+
        if (((uint32_t) urb->hcpriv & 0xf0000000) == 0) {
                DWC_PRINTF("%s error: urb->hcpriv %p urb %p, count %d!!!\n",
                           __func__, urb->hcpriv, urb,
@@ -1172,7 +1172,7 @@ out2:
                DWC_PRINTF("Called usb_hcd_giveback_urb()\n");
                DWC_PRINTF("  urb->status = %d\n", urb->status);
        }
-out1:
+
        return 0;
 }