From 2615f3759b7b7d47a2fa894bc9f45286bdf122d7 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 8 May 2012 21:36:20 +0200 Subject: [PATCH] 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 Signed-off-by: John W. Linville --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 6cba00173a2f..177df03064cf 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -880,7 +880,7 @@ u16 cfg80211_calculate_bitrate(struct rate_info *rate) return rate->legacy; /* the formula below does only work for MCS values smaller than 32 */ - if (rate->mcs >= 32) + if (WARN_ON_ONCE(rate->mcs >= 32)) return 0; modulation = rate->mcs & 7; -- 2.30.2