]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
usb: dwc3: gadget: Return success always for kick transfer in ep queue
authorWesley Cheng <wcheng@codeaurora.org>
Fri, 7 May 2021 17:55:19 +0000 (10:55 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 13:02:19 +0000 (15:02 +0200)
BugLink: https://bugs.launchpad.net/bugs/1930474
commit 18ffa988dbae69cc6e9949cddd9606f6fe533894 upstream.

If an error is received when issuing a start or update transfer
command, the error handler will stop all active requests (including
the current USB request), and call dwc3_gadget_giveback() to notify
function drivers of the requests which have been stopped.  Avoid
returning an error for kick transfer during EP queue, to remove
duplicate cleanup operations on the request being queued.

Fixes: 8d99087c2db8 ("usb: dwc3: gadget: Properly handle failed kick_transfer")
cc: stable@vger.kernel.org
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1620410119-24971-1-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/dwc3/gadget.c

index af8efebfaf110302a70d3def6cb369374f396286..40fe856184efa1052c0cc6db342d670e4867baac 100644 (file)
@@ -1566,7 +1566,9 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
                }
        }
 
-       return __dwc3_gadget_kick_transfer(dep);
+       __dwc3_gadget_kick_transfer(dep);
+
+       return 0;
 }
 
 static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,