aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-30 12:43:20 -0400
committerFelipe Balbi <balbi@ti.com>2014-10-20 16:58:49 -0400
commit6856d30c6c0038dc0648009853533af3af6c5ba8 (patch)
tree068e853063293838a811e7fcb78a0d6e91eb9b2d
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>
-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,
789 789
790 dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS; 790 dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS;
791 791
792 r = next_request(&ep0->request_list);
793 ur = &r->request;
794
795 trb = dwc->ep0_trb; 792 trb = dwc->ep0_trb;
796 793
797 status = DWC3_TRB_SIZE_TRBSTS(trb->size); 794 status = DWC3_TRB_SIZE_TRBSTS(trb->size);
@@ -804,6 +801,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
804 return; 801 return;
805 } 802 }
806 803
804 r = next_request(&ep0->request_list);
805 if (!r)
806 return;
807
808 ur = &r->request;
809
807 length = trb->size & DWC3_TRB_SIZE_MASK; 810 length = trb->size & DWC3_TRB_SIZE_MASK;
808 811
809 if (dwc->ep0_bounced) { 812 if (dwc->ep0_bounced) {