Search Linux Wireless

[PATCH] wifi: mac80211: avoid warning of no supported legacy rate if empty rate mask for rate control

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

 



The commit 9df66d5b9f45 ("cfg80211: fix default HE tx bitrate mask in 2G
band") correct bitmask of HE MCS, and settings of empty legacy rate plus
HE MCS rate are correctly recognized instead of returning -EINVAL,
so empty legacy rate propagates to __rate_control_send_low() and warn
no supported rate.

Since the rate_mask is intentionally set to empty via nl80211, change logic
to avoid warning no supported rate if rate_mask is empty.

Reported-by: syzbot+8dd98a9e98ee28dc484a@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 9df66d5b9f45 ("cfg80211: fix default HE tx bitrate mask in 2G band")
Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
---
 net/mac80211/rate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 4dc1def69548..5787cb20de42 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -377,7 +377,7 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
 		info->control.rates[0].idx = i;
 		break;
 	}
-	WARN_ONCE(i == sband->n_bitrates,
+	WARN_ONCE(i == sband->n_bitrates && rate_mask,
 		  "no supported rates for sta %pM (0x%x, band %d) in rate_mask 0x%x with flags 0x%x\n",
 		  sta ? sta->addr : NULL,
 		  sta ? sta->deflink.supp_rates[sband->band] : -1,
-- 
2.25.1





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux