dect
/
linux-2.6
Archived
13
0
Fork 0

mac80211: Check rate->idx before rate->count

The drivers are not required to fill in rate->count if rate->idx is set
to -1. Hence, we should first check rate->idx before accessing
rate->count.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Helmut Schaa 2011-11-14 15:28:19 +01:00 committed by John W. Linville
parent a7f23f0a8f
commit b79296beeb
1 changed files with 2 additions and 2 deletions

View File

@ -300,10 +300,10 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
static bool
minstrel_ht_txstat_valid(struct ieee80211_tx_rate *rate)
{
if (!rate->count)
if (rate->idx < 0)
return false;
if (rate->idx < 0)
if (!rate->count)
return false;
return !!(rate->flags & IEEE80211_TX_RC_MCS);