浏览代码

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>
Felipe Balbi 11 年之前
父节点
当前提交
6856d30c6c
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      drivers/usb/dwc3/ep0.c

+ 6 - 3
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;
 	dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS;
 
 
-	r = next_request(&ep0->request_list);
-	ur = &r->request;
-
 	trb = dwc->ep0_trb;
 	trb = dwc->ep0_trb;
 
 
 	status = DWC3_TRB_SIZE_TRBSTS(trb->size);
 	status = DWC3_TRB_SIZE_TRBSTS(trb->size);
@@ -804,6 +801,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 		return;
 		return;
 	}
 	}
 
 
+	r = next_request(&ep0->request_list);
+	if (!r)
+		return;
+
+	ur = &r->request;
+
 	length = trb->size & DWC3_TRB_SIZE_MASK;
 	length = trb->size & DWC3_TRB_SIZE_MASK;
 
 
 	if (dwc->ep0_bounced) {
 	if (dwc->ep0_bounced) {