All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jirislaby@gmail.com>, Felix Fietkau <nbd@openwrt.org>
Subject: [PATCH 1/2] mac80211: minstrel, fix memory corruption
Date: Mon,  4 May 2009 18:04:55 +0200	[thread overview]
Message-ID: <1241453096-8517-1-git-send-email-jirislaby@gmail.com> (raw)

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


             reply	other threads:[~2009-05-04 16:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 16:04 Jiri Slaby [this message]
2009-05-04 16:04 ` [PATCH 2/2] mac80211: pid, fix memory corruption 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
  -- strict thread matches above, loose matches on Subject: below --
2009-05-05 18:43 Karol Szuster

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=1241453096-8517-1-git-send-email-jirislaby@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.