Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfg80211: add warning when calculating MCS rates >= 32

cfg80211_calculate_bitrate() doesn't work for MCS
rates 32 or higher, and it has always returned 0
in that case. Warn if it ever really happens.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
2615f375 4472037b

+1 -1
+1 -1
net/wireless/util.c
··· 880 880 return rate->legacy; 881 881 882 882 /* the formula below does only work for MCS values smaller than 32 */ 883 - if (rate->mcs >= 32) 883 + if (WARN_ON_ONCE(rate->mcs >= 32)) 884 884 return 0; 885 885 886 886 modulation = rate->mcs & 7;