Patch "wifi: mac80211: fix off-by-one link setting" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mac80211: fix off-by-one link setting

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mac80211-fix-off-by-one-link-setting.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 68a6fe1954ebb8c521cf13fb076032b7fe8ff874
Author: Johannes Berg <johannes.berg@xxxxxxxxx>
Date:   Tue Feb 14 20:08:15 2023 +0100

    wifi: mac80211: fix off-by-one link setting
    
    [ Upstream commit cf08e29db760b144bde51e2444f3430c75763e26 ]
    
    The convention for find_first_bit() is 0-based, while ffs()
    is 1-based, so this is now off-by-one. I cannot reproduce the
    gcc-9 problem, but since the -1 is now removed, I'm hoping it
    will still avoid the original issue.
    
    Reported-by: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>
    Fixes: 1d8d4af43474 ("wifi: mac80211: avoid u32_encode_bits() warning")
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 118648af979c7..7699fb4106701 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4434,7 +4434,7 @@ static void ieee80211_mlo_multicast_tx(struct net_device *dev,
 	u32 ctrl_flags = IEEE80211_TX_CTRL_MCAST_MLO_FIRST_TX;
 
 	if (hweight16(links) == 1) {
-		ctrl_flags |= u32_encode_bits(find_first_bit(&links, 16) - 1,
+		ctrl_flags |= u32_encode_bits(__ffs(links),
 					      IEEE80211_TX_CTRL_MLO_LINK);
 
 		__ieee80211_subif_start_xmit(skb, sdata->dev, 0, ctrl_flags,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux