Merge tag 'v5.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 07:04:41 +0000 (09:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 07:04:41 +0000 (09:04 +0200)
Peter writes:

Fixes one issue with dequeuing requests after disabling endpoint for cdnsp udc driver

* tag 'v5.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb:
  usb: cdnsp: Fixes issue with dequeuing requests after disabling endpoint

drivers/usb/cdns3/cdnsp-gadget.c

index f2ebbac..d7d4bdd 100644 (file)
@@ -1128,6 +1128,10 @@ static int cdnsp_gadget_ep_dequeue(struct usb_ep *ep,
                return -ESHUTDOWN;
        }
 
+       /* Requests has been dequeued during disabling endpoint. */
+       if (!(pep->ep_state & EP_ENABLED))
+               return 0;
+
        spin_lock_irqsave(&pdev->lock, flags);
        ret = cdnsp_ep_dequeue(pep, to_cdnsp_request(request));
        spin_unlock_irqrestore(&pdev->lock, flags);