linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] minstrel_ht: fix BUG_ON(rate[0]->idx < 0)
@ 2010-03-21  2:44 Christian Lamparter
  0 siblings, 0 replies; only message in thread
From: Christian Lamparter @ 2010-03-21  2:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau

This patch fixes a panic which can be triggered by an
out-of-bound array access.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES];
---
--- a/net/mac80211/rc80211_minstrel_ht.c.orig	2010-03-21 03:30:04.000000000 +0100
+++ b/net/mac80211/rc80211_minstrel_ht.c	2010-03-21 03:30:33.000000000 +0100
@@ -318,9 +318,9 @@ minstrel_next_sample_idx(struct minstrel
 		if (!mg->supported)
 			continue;
 
-		if (++mg->index > MCS_GROUP_RATES) {
+		if (++mg->index >= MCS_GROUP_RATES) {
 			mg->index = 0;
-			if (++mg->column > ARRAY_SIZE(sample_table))
+			if (++mg->column >= ARRAY_SIZE(sample_table))
 				mg->column = 0;
 		}
 		break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-21  2:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-21  2:44 [PATCH] minstrel_ht: fix BUG_ON(rate[0]->idx < 0) Christian Lamparter

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).