public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: minstrel, fix memory corruption
@ 2009-05-04 16:04 Jiri Slaby
  2009-05-04 16:04 ` [PATCH 2/2] mac80211: pid, " Jiri Slaby
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Jiri Slaby @ 2009-05-04 16:04 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, linux-kernel, Jiri Slaby, Felix Fietkau

minstrel doesn't count max rate count in fact, since it doesn't use
a loop variable `i' and hence allocs space only for bitrates found in
the first band.

Fix it by involving the `i' as an index so that it traverses all the
bands now and finds the real max bitrate count.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/rc80211_minstrel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 3824990..70df3dc 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -476,7 +476,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
 		return NULL;
 
 	for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
-		sband = hw->wiphy->bands[hw->conf.channel->band];
+		sband = hw->wiphy->bands[i];
 		if (sband->n_bitrates > max_rates)
 			max_rates = sband->n_bitrates;
 	}
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-05-15 21:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 16:04 [PATCH 1/2] mac80211: minstrel, fix memory corruption Jiri Slaby
2009-05-04 16:04 ` [PATCH 2/2] mac80211: pid, " Jiri Slaby
2009-05-04 16:07   ` Johannes Berg
2009-05-04 16:10     ` [PATCH v2 " Jiri Slaby
2009-05-04 16:17 ` [PATCH 1/2] mac80211: minstrel, " Bob Copeland
2009-05-04 16:40 ` Felix Fietkau
2009-05-04 18:38 ` Luis R. Rodriguez
2009-05-04 18:41   ` Jiri Slaby
2009-05-15 18:21 ` Heinz Diehl
2009-05-15 18:33   ` John W. Linville
2009-05-15 18:49     ` Linus Torvalds
2009-05-15 18:53       ` John W. Linville
2009-05-15 21:25       ` Marcel Holtmann
2009-05-15 21:32         ` Linus Torvalds
2009-05-15 18:40   ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox