1
0
Fork 0

mac80211: minstrel_ht: fix infinite loop because supported is not being shifted

Currently the for-loop will spin forever if variable supported is
non-zero because supported is never changed.  Fix this by adding in
the missing right shift of supported.

Addresses-Coverity: ("Infinite loop")
Fixes: 48cb39522a ("mac80211: minstrel_ht: improve rate probing for devices with static fallback")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190822122034.28664-1-colin.king@canonical.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
alistair/sunxi64-5.4-dsi
Colin Ian King 2019-08-22 13:20:34 +01:00 committed by Johannes Berg
parent c76c992525
commit b26af93044
1 changed files with 1 additions and 1 deletions

View File

@ -634,7 +634,7 @@ minstrel_ht_rate_sample_switch(struct minstrel_priv *mp,
u16 supported = mi->supported[g_idx];
supported >>= mi->max_tp_rate[0] % MCS_GROUP_RATES;
for (i = 0; supported; i++) {
for (i = 0; supported; supported >>= 1, i++) {
if (!(supported & 1))
continue;