Skip to content

Commit

Permalink
usb: dwc3: gadget: check for empty started_list after cleaning comple…
Browse files Browse the repository at this point in the history
…ted requests

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>
  • Loading branch information
Anurag Kumar Vulisha authored and Michal Simek committed Apr 16, 2019
1 parent 8cf0517 commit d669f04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/usb/dwc3/gadget.c
Expand Up @@ -2486,18 +2486,18 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
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;
Expand Down

0 comments on commit d669f04

Please sign in to comment.