RE: [PATCH v1] realtek/rtlwifi: ensure unicast is reinitialized to false in each iteration
From: Ping-Ke Shih
Date: Tue Nov 25 2025 - 02:24:17 EST
Les Boys <lesboyspp43@xxxxxxxxxxx> wrote:
Subject should be "[PATCH rtw-next] wifi: rtlwifi: ..."
>
> Previously, the unicast variable was only initialized once during the function execution. Therefore, if
> unicast was set to true in the (n-1)th iteration, it would affect the nth iteration. This patch resolves
> the issue by reinitializing unicast to false at the start of each iteration.
75 characters per lines.
Does this affect your use actually?
>
> Signed-off-by: LBLaiSiNanHai <lesboyspp43@xxxxxxxxxxx>
Not sure if this is your real name? And, it should be the same as From field.
> ---
> drivers/net/wireless/realtek/rtlwifi/pci.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index d08046926..fe7140328 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -752,6 +752,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
> memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
> sizeof(rx_status));
>
> + unicast = false;
> +
Indentation is weird.
More, initializer of `unicast` can be removed, and here can be
if (is_unicast_ether_addr(hdr->addr1)) {
unicast = true;
rtlpriv->stats.rxbytesunicast += skb->len;
} else {
unicast = false;
}
(I don't think TODO is still useful for now)
> if (is_broadcast_ether_addr(hdr->addr1)) {
> ;/*TODO*/
> } else if (is_multicast_ether_addr(hdr->addr1)) {
> --
> 2.44.0