USB: fix usb lock without unlock if req->queue is not empty
authorwlf <wulf@rock-chips.com>
Wed, 22 May 2013 09:33:38 +0000 (17:33 +0800)
committerwlf <wulf@rock-chips.com>
Wed, 22 May 2013 09:33:38 +0000 (17:33 +0800)
drivers/usb/dwc_otg/dwc_otg_pcd.c

index ba9516bc9c0e82e0c965fa0b69d109f88a9357d3..a9b05d6ebea67649956b79a598f28cb42804cffc 100755 (executable)
@@ -568,11 +568,14 @@ static int dwc_otg_pcd_ep_queue(struct usb_ep *_ep,
        /* 20091226,HSL@RK */
        if ( !list_empty(&req->queue) ) 
        {
-        while(!list_empty(&req->queue) ) {
-                ep = container_of(_ep, dwc_otg_pcd_ep_t, ep);
-                request_done(ep, req, -ECONNABORTED);
-        DWC_PRINT("%s::ep %s req not empty,done it error!\n" , __func__, _ep->name);
-        }
+               list_del_init(&req->queue);
+               ep = container_of(_ep, dwc_otg_pcd_ep_t, ep);
+               DWC_PRINT("%s::ep %s req not empty,done it error!\n" , __func__, _ep->name);
+               ep->pcd->vbus_status = 0;
+               if(ep->pcd->conn_status)
+               {
+                       ep->pcd->conn_status = 0;
+               }
                return -EINVAL;
        }