[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL411-puh4pUoZ0r=BRoohchnmKJDmbioHpmUcAR9NJAu3iYQA@mail.gmail.com>
Date: Fri, 25 Aug 2023 09:10:42 +0800
From: Peter Chen <hzpeterchen@...il.com>
To: Pawel Laszczak <pawell@...ence.com>
Cc: peter.chen@...nel.org, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] usb: cdnsp: Fixes issue with dequeuing not queued requests
On Thu, Jul 13, 2023 at 4:14 PM Pawel Laszczak <pawell@...ence.com> wrote:
>
> 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@...r.kernel.org>
> Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
> Signed-off-by: Pawel Laszczak <pawell@...ence.com>
> ---
Acked-by: Peter Chen <peter.chen@...nel.org>
Peter
> drivers/usb/cdns3/cdnsp-gadget.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
> index fff9ec9c391f..3a30c2af0c00 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",
> --
> 2.37.2
>
Powered by blists - more mailing lists