summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPawel Laszczak <pawell@cadence.com>2023-07-13 11:14:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-02 14:19:13 +0300
commit34f08eb0ba6e4869bbfb682bf3d7d0494ffd2f87 (patch)
treeeb316da0535b7c9e139d86e78284494c0ccc058d /drivers/usb/cdns3
parent57e50f4bad02823fb19609e7a2150d8d866db91b (diff)
downloadlinux-34f08eb0ba6e4869bbfb682bf3d7d0494ffd2f87.tar.xz
usb: cdnsp: Fixes issue with dequeuing not queued requests
Gadget ACM while unloading module try to dequeue not queued usb request which causes the kernel to crash. Patch adds extra condition to check whether usb request is processed by CDNSP driver. cc: stable@vger.kernel.org Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Signed-off-by: Pawel Laszczak <pawell@cadence.com> Acked-by: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/20230713081429.326660-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/cdnsp-gadget.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index fff9ec9c391f..4b67749edb99 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -1125,6 +1125,9 @@ static int cdnsp_gadget_ep_dequeue(struct usb_ep *ep,
unsigned long flags;
int ret;
+ if (request->status != -EINPROGRESS)
+ return 0;
+
if (!pep->endpoint.desc) {
dev_err(pdev->dev,
"%s: can't dequeue to disabled endpoint\n",