From: Ping-Ke Shih <pkshih@realtek.com>
To: kimwooseok <5mghybrid@khu.ac.kr>, Jes Sorensen <Jes.Sorensen@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH wireless 1/4] wifi: rtl8xxxu: free RX skb when URB submission fails
Date: Thu, 17 Sep 2026 01:11:53 +0000 [thread overview]
Message-ID: <0b970cf2ade94c569eab459ca996acab@realtek.com> (raw)
In-Reply-To: <CAH1Bc_xSxOrEUjx11NtTE9Y6WVitF8K0mVws8s3623C8O=Lpkw@mail.gmail.com>
kimwooseok <5mghybrid@khu.ac.kr> wrote:
> A failed RX URB submission can leak the skb allocated for that attempt.
> rtl8xxxu_submit_rx_urb() allocates the buffer and stores it in urb.context,
> but if usb_submit_urb() fails, it only unanchors the URB. The RX worker
> queues ENOMEM/EAGAIN failures for retry with that buffer still attached.
>
> On the next attempt, rtl8xxxu_submit_rx_urb() allocates another skb and
> overwrites urb.context, losing the reference to the previous buffer.
> Stopping before the retry also leaks the buffer because pending-request
> cleanup frees only the URB.
>
> Fix the leak at the submission failure by making rtl8xxxu_submit_rx_urb()
> responsible for both allocating the skb and releasing it when submission
> fails. Free the newly allocated skb and clear urb.context before returning
> the error, so neither retry nor stop receives a pending URB that still
> owns a buffer. Remove the caller-side skb cleanup from start and the RX
> worker; those callers now handle only whether to retry or release the URB.
>
> Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
> Assisted-by: GPT-6 Astra
> Signed-off-by: kimwooseok <5mghybrid@khu.ac.kr>
Can you give your s-o-b more formal? Like, Kim Woo-Seok?
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
next prev parent reply other threads:[~2026-09-17 1:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 20:27 [PATCH wireless 0/4] wifi: rtl8xxxu: keep RX requests available across transient errors kimwooseok
2026-09-12 20:29 ` [PATCH wireless 1/4] wifi: rtl8xxxu: free RX skb when URB submission fails kimwooseok
2026-09-17 1:11 ` Ping-Ke Shih [this message]
2026-09-17 1:19 ` Ping-Ke Shih
2026-09-12 20:29 ` [PATCH wireless 2/4] wifi: rtl8xxxu: unwind incomplete receive startup kimwooseok
2026-09-12 20:30 ` [PATCH wireless 3/4] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors kimwooseok
2026-09-12 20:30 ` [PATCH wireless 4/4] wifi: rtl8xxxu: test RX ownership and recovery across failures kimwooseok
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=0b970cf2ade94c569eab459ca996acab@realtek.com \
--to=pkshih@realtek.com \
--cc=5mghybrid@khu.ac.kr \
--cc=Jes.Sorensen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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
all inboxes | Powered by JetHome®