aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdns3-gadget.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2024-03-13 08:43:21 +0000
committerThomas Zimmermann <[email protected]>2024-03-13 08:43:21 +0000
commita2e7496b453eaa577425858d6f8b854800ed7343 (patch)
tree35d05023d51161a28768a29115c8e03e65599fe5 /drivers/usb/cdns3/cdns3-gadget.c
parentnouveau/dmem: handle kcalloc() allocation failure (diff)
parentnouveau: lock the client object tree. (diff)
downloadkernel-a2e7496b453eaa577425858d6f8b854800ed7343.tar.gz
kernel-a2e7496b453eaa577425858d6f8b854800ed7343.zip
Merge drm/drm-fixes into drm-misc-fixes
Backmerging to sync before merging the patchset at [1]. [1] https://lore.kernel.org/all/[email protected]/ Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-gadget.c')
-rw-r--r--drivers/usb/cdns3/cdns3-gadget.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index aeca902ab6cc..fd1beb10bba7 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -828,7 +828,11 @@ void cdns3_gadget_giveback(struct cdns3_endpoint *priv_ep,
return;
}
- if (request->complete) {
+ /*
+ * zlp request is appended by driver, needn't call usb_gadget_giveback_request() to notify
+ * gadget composite driver.
+ */
+ if (request->complete && request->buf != priv_dev->zlp_buf) {
spin_unlock(&priv_dev->lock);
usb_gadget_giveback_request(&priv_ep->endpoint,
request);
@@ -2540,11 +2544,11 @@ static int cdns3_gadget_ep_disable(struct usb_ep *ep)
while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
+ list_del_init(&priv_req->list);
kfree(priv_req->request.buf);
cdns3_gadget_ep_free_request(&priv_ep->endpoint,
&priv_req->request);
- list_del_init(&priv_req->list);
--priv_ep->wa2_counter;
}