From: Greg KH <gregkh@linuxfoundation.org>
To: Chen Yufeng <chenyufeng@iie.ac.cn>
Cc: pawell@cadence.com, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: cdns2: fix memory double free in cdns2_gadget_giveback
Date: Wed, 8 Oct 2025 13:15:07 +0200 [thread overview]
Message-ID: <2025100856-trend-haunt-fcc3@gregkh> (raw)
In-Reply-To: <20250908150425.229-1-chenyufeng@iie.ac.cn>
On Mon, Sep 08, 2025 at 11:04:25PM +0800, Chen Yufeng wrote:
> A patch similar to commit 5fd9e45f1ebc("usb: cdns3: fix memory double
> free when handle zero packet").
>
> As 5fd9e45f1ebc points out, the cdns2_gadget_giveback() function also has
> the same memory double free issue when handling zero-length packets.
>
> Add check for usb_gadget_giveback_request() to avoid double free of memory.
> If it's additional zero length packet request, do not call
> usb_gadget_giveback_request().
>
> Signed-off-by: Chen Yufeng <chenyufeng@iie.ac.cn>
> ---
> drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
What commit id does this fix?
thanks,
greg k-h
next prev parent reply other threads:[~2025-10-08 11:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 15:04 [PATCH] usb: cdns2: fix memory double free in cdns2_gadget_giveback Chen Yufeng
2025-10-08 11:15 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-12-26 3:17 ReBeating
2026-01-07 15:05 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025100856-trend-haunt-fcc3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=chenyufeng@iie.ac.cn \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.