From: Ping-Ke Shih <pkshih@realtek.com>
To: Wanhui Fu <fuwh1120@163.com>,
"linville@tuxdriver.com" <linville@tuxdriver.com>,
"jussi.kivilinna@iki.fi" <jussi.kivilinna@iki.fi>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH] rtlwifi: usb: Fix a memory leak on URB submission failure
Date: Mon, 30 Nov 2026 07:20:52 +0000 [thread overview]
Message-ID: <5fd3b2868ff84acf963db491babeab47@realtek.com> (raw)
In-Reply-To: <20261130060437.2257472-1-fuwh1120@163.com>
Wanhui Fu <fuwh1120@163.com> wrote:
> _rtl_prep_rx_urb() allocates a buffer. If usb_submit_urb()
Will reword as "allocates a coherent buffer".
No need to resend because of this.
> fails, this buffer is not anchored in rx_cleanup_urbs,
> thus no cleaup callback invoked, casuing a memory leak.
>
> Free the coherent buffer before freeing the URB on this
> error path.
>
> Found it by a self-developed static analysis tool and
> compile-test passed.
>
> Fixes: 872de8ff0492 ("rtlwifi: usb: use usb_alloc_coherent for RX buffers")
> Signed-off-by: Wanhui Fu <fuwh1120@163.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
prev parent reply other threads:[~2026-11-30 7:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 6:04 [PATCH] rtlwifi: usb: Fix a memory leak on URB submission failure Wanhui Fu
2026-11-30 7:20 ` Ping-Ke Shih [this message]
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=5fd3b2868ff84acf963db491babeab47@realtek.com \
--to=pkshih@realtek.com \
--cc=fuwh1120@163.com \
--cc=jussi.kivilinna@iki.fi \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox