提交 b79296be 编写于 作者: H Helmut Schaa 提交者: John W. Linville

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: NHelmut Schaa <helmut.schaa@googlemail.com>
Acked-by: NFelix Fietkau <nbd@openwrt.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a7f23f0a
...@@ -300,10 +300,10 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ...@@ -300,10 +300,10 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
static bool static bool
minstrel_ht_txstat_valid(struct ieee80211_tx_rate *rate) minstrel_ht_txstat_valid(struct ieee80211_tx_rate *rate)
{ {
if (!rate->count) if (rate->idx < 0)
return false; return false;
if (rate->idx < 0) if (!rate->count)
return false; return false;
return !!(rate->flags & IEEE80211_TX_RC_MCS); return !!(rate->flags & IEEE80211_TX_RC_MCS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册