summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/ep0.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-30 11:43:20 -0500
committerFelipe Balbi <balbi@ti.com>2014-10-20 15:58:49 -0500
commit6856d30c6c0038dc0648009853533af3af6c5ba8 (patch)
tree068e853063293838a811e7fcb78a0d6e91eb9b2d /drivers/usb/dwc3/ep0.c
parent7d643664ea559b36188cae264047ce3c9bfec3a2 (diff)
usb: dwc3: ep0: return early on NULL requests
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>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r--drivers/usb/dwc3/ep0.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index ae6b5753fe67..a47cc1e97fae 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -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) {