From: Helmut Schaa <helmut.schaa@googlemail.com>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, nbd@openwrt.org,
Helmut Schaa <helmut.schaa@googlemail.com>
Subject: [PATCH 2/3] mac80211: Check rate->idx before rate->count
Date: Mon, 14 Nov 2011 15:28:19 +0100 [thread overview]
Message-ID: <1321280900-24006-2-git-send-email-helmut.schaa@googlemail.com> (raw)
In-Reply-To: <1321280900-24006-1-git-send-email-helmut.schaa@googlemail.com>
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>
---
net/mac80211/rc80211_minstrel_ht.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 63f1821..3d76fd7 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -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);
--
1.7.3.4
next prev parent reply other threads:[~2011-11-14 14:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 14:28 [PATCH 1/3] mac80211: Minor optimization in minstrel_ht tx status path Helmut Schaa
2011-11-14 14:28 ` Helmut Schaa [this message]
2011-11-14 14:28 ` [PATCH 3/3] mac80211: Get rid of search loop for rate group index Helmut Schaa
2011-11-14 14:40 ` Felix Fietkau
2011-11-16 15:39 ` [PATCH 1/3] mac80211: Minor optimization in minstrel_ht tx status path Stanislaw Gruszka
2011-11-16 16:02 ` Helmut Schaa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321280900-24006-2-git-send-email-helmut.schaa@googlemail.com \
--to=helmut.schaa@googlemail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=nbd@openwrt.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).