From: Ping-Ke Shih <pkshih@realtek.com>
To: "5mghybrid@khu.ac.kr" <5mghybrid@khu.ac.kr>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH rtw-next v2 1/4] wifi: rtl8xxxu: free RX skb when URB submission fails
Date: Thu, 17 Sep 2026 01:18:10 +0000 [thread overview]
Message-ID: <de086af71cc346d9ac8ca4e7bf8787e0@realtek.com> (raw)
In-Reply-To: <20260913-codex-rtw-rx-v2-v2-1-f09c964e0b96@khu.ac.kr>
kimwooseok via B4 Relay <devnull+5mghybrid.khu.ac.kr@kernel.org> wrote:
> From: kimwooseok <5mghybrid@khu.ac.kr>
>
> 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:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 7:33 [PATCH rtw-next v2 0/4] wifi: rtl8xxxu: keep RX requests available across transient errors kimwooseok via B4 Relay
2026-09-13 7:33 ` [PATCH rtw-next v2 1/4] wifi: rtl8xxxu: free RX skb when URB submission fails kimwooseok via B4 Relay
2026-09-17 1:18 ` Ping-Ke Shih [this message]
2026-09-17 1:57 ` 김우석[학생](전자정보대학 전자공학과)
2026-09-17 7:31 ` 김우석[학생](전자정보대학 전자공학과)
2026-09-13 7:33 ` [PATCH rtw-next v2 2/4] wifi: rtl8xxxu: unwind incomplete receive startup kimwooseok via B4 Relay
2026-09-17 3:20 ` Ping-Ke Shih
2026-09-17 7:27 ` 김우석[학생](전자정보대학 전자공학과)
2026-09-13 7:33 ` [PATCH rtw-next v2 3/4] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors kimwooseok via B4 Relay
2026-09-17 3:45 ` Ping-Ke Shih
2026-09-17 7:29 ` 김우석[학생](전자정보대학 전자공학과)
2026-09-17 7:52 ` Ping-Ke Shih
2026-09-13 7:33 ` [PATCH rtw-next v2 4/4] wifi: rtl8xxxu: test RX ownership and recovery across failures kimwooseok via B4 Relay
2026-09-17 6:27 ` Ping-Ke Shih
2026-09-17 7:30 ` 김우석[학생](전자정보대학 전자공학과)
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=de086af71cc346d9ac8ca4e7bf8787e0@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®