From: Ping-Ke Shih <pkshih@realtek.com>
To: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>, Bin Yu <byu@xidian.edu.cn>,
Cheng Wen <wencheng@xidian.edu.cn>
Subject: RE: [PATCH] wifi: rtw88: usb: drop RX frames received before the device is started
Date: Mon, 19 Oct 2026 02:21:20 +0000 [thread overview]
Message-ID: <69c2ba63fab645e6bc8df5af65bbb2bb@realtek.com> (raw)
In-Reply-To: <20261016161931.18495-1-25031212351@stu.xidian.edu.cn>
YuanZhe Liu <25031212351@stu.xidian.edu.cn> wrote:
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index 64e1c3420e0a..12fb669015d1 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -664,7 +664,7 @@ static void rtw_usb_rx_handler(struct work_struct *work)
>
> if (pkt_stat.is_c2h) {
> rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb);
> - } else {
> + } else if (test_bit(RTW_FLAG_RUNNING, rtwdev->flags)) {
Patch content is fine to me, but I prefer the style:
if (is_c2h) {
...
} else {
if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags)) {
dev_kfree_skb_any(skb);
goto skip_packet;
}
...
}
No need additional comment for it.
> skb_pull(skb, pkt_offset);
> rtw_update_rx_freq_for_invalid(rtwdev, skb,
> &rx_status,
> @@ -672,6 +672,14 @@ static void rtw_usb_rx_handler(struct work_struct *work)
> rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
> memcpy(skb->cb, &rx_status, sizeof(rx_status));
> ieee80211_rx_irqsafe(rtwdev->hw, skb);
> + } else {
> + /*
> + * RX URBs are submitted at the end of probe,
> + * so frames can arrive before the device has
> + * been started. mac80211 does not accept
> + * frames in that state, so drop them here.
> + */
> + dev_kfree_skb_any(skb);
> }
>
> skip_packet:
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-10-19 2:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 16:19 YuanZhe Liu
2026-10-17 9:47 ` Luka Gejak
2026-10-19 2:21 ` Ping-Ke Shih [this message]
2026-10-19 6:40 ` [PATCH v2] " YuanZhe Liu
2026-10-19 6:44 ` Ping-Ke Shih
2026-10-19 7:22 ` Luka Gejak
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=69c2ba63fab645e6bc8df5af65bbb2bb@realtek.com \
--to=pkshih@realtek.com \
--cc=25031212351@stu.xidian.edu.cn \
--cc=byu@xidian.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=wencheng@xidian.edu.cn \
/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®