The code in dwc3_gadget_endpoint_transfer_in_progress() checks for
the empty value in started_list before cleaning up the complted
requests. Since the present working request is not yet cleaned from
started_list, the list_empty(started_list) always returns non-empty.
This patch corrects the code by moving the list_empty(started_list)
check after calling dwc3_gadget_ep_cleanup_completed_requests()
Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
status = -ECONNRESET;
if ((event->status & DEPEVT_STATUS_MISSED_ISOC) &&
- usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
+ usb_endpoint_xfer_isoc(dep->endpoint.desc))
status = -EXDEV;
- if (list_empty(&dep->started_list))
- stop = true;
- }
-
dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
if (dep->stream_capable && !list_empty(&dep->started_list))
__dwc3_gadget_kick_transfer(dep);
+ if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
+ list_empty(&dep->started_list))
+ stop = true;
+
if (stop) {
dwc3_stop_active_transfer(dep, true);
dep->flags = DWC3_EP_ENABLED;