]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: dwc3: ep0: return early on NULL requests
authorFelipe Balbi <balbi@ti.com>
Tue, 30 Sep 2014 16:43:20 +0000 (11:43 -0500)
committerFelipe Balbi <balbi@ti.com>
Mon, 20 Oct 2014 20:58:49 +0000 (15:58 -0500)
if our list of requests is empty, return early.

There's really nothing to be done in case our
request list is empty anyway because the only
situation where we our list is empty, is when
we're transferring ZLPs.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/ep0.c

index ae6b5753fe670e3b6b94f46bd40b46b8eb286bde..a47cc1e97fae037151b35ff8666f5b7e98cb3429 100644 (file)
@@ -789,9 +789,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 
        dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS;
 
-       r = next_request(&ep0->request_list);
-       ur = &r->request;
-
        trb = dwc->ep0_trb;
 
        status = DWC3_TRB_SIZE_TRBSTS(trb->size);
@@ -804,6 +801,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
                return;
        }
 
+       r = next_request(&ep0->request_list);
+       if (!r)
+               return;
+
+       ur = &r->request;
+
        length = trb->size & DWC3_TRB_SIZE_MASK;
 
        if (dwc->ep0_bounced) {