diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-02-14 22:08:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-10 11:33:05 +0300 |
commit | 558496d79b8c289a026a9fee12f15b14fc4d6d1c (patch) | |
tree | 3621af1aa18fb3d81010a1092d797d42aacdf612 | |
parent | 2a0200daeccf95d05bfcc5b4ce9c668f72cd1f8a (diff) | |
download | linux-558496d79b8c289a026a9fee12f15b14fc4d6d1c.tar.xz |
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@intel.com>
Fixes: 1d8d4af43474 ("wifi: mac80211: avoid u32_encode_bits() warning")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/mac80211/tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 55220e764de6..6a1708db652f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4395,7 +4395,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, |