Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2181,9 +2181,20 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
}
}

dev_err(dwc->dev, "request %p was not queued to %s\n",
request, ep->name);
ret = -EINVAL;
/*
* The request is on none of this endpoint's lists. That is the
* expected state once it has been given back: a function may dequeue
* a request before freeing it, and f_fs does so unconditionally for
* ep0req in functionfs_unbind(). Nothing is queued, which is what the
* caller asked for, so report success. Any other status means the
* request was never queued here or the driver lost track of it, and
* stays an error.
*/
if (req->status != DWC3_REQUEST_STATUS_COMPLETED) {
dev_err(dwc->dev, "request %p was not queued to %s\n",
request, ep->name);
ret = -EINVAL;
}
out:
spin_unlock_irqrestore(&dwc->lock, flags);

Expand Down