[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1239152072.8456.39.camel@johannes.local>
Date: Wed, 08 Apr 2009 02:54:32 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Bob Copeland <me@...copeland.com>
Cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kernel Testers List <kernel-testers@...r.kernel.org>,
"Sergey S. Kostyliov" <rathamahata@...il.com>,
Felix Fietkau <nbd@...nwrt.org>
Subject: Re: [Bug #12490] ath5k related kernel panic in 2.6.29-rc1
On Tue, 2009-04-07 at 20:46 -0400, Bob Copeland wrote:
> On Tue, Apr 07, 2009 at 12:03:45PM +0200, Johannes Berg wrote:
> >
> > > Anyway here's a patch to buy some time. Johannes, would this be
> > > an acceptable band-aid for now?
> >
> > This is going to make it print two warnings for one occurrence of the
> > problem though. I'd much prefer to put something into minstrel.c to
> > catch when _it_ returns bogus values and in that case return 0, that way
> > at least the bandaid is restricted to the code it patches up.
>
> Ok, then maybe something like this?
>
> I think this covers most of the bases: if the driver is returning crap or
> the ->cb gets corrupted, it'll get caught in tx_status. If minstrel
> stuffs a -1 in the first slot for any other reason we'll get a warning
> before get_tx_rate and a hopefully valid index gets substituted.
Yeah, that looks nicer, thanks.
> diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
> index 3824990..1cf7152 100644
> --- a/net/mac80211/rc80211_minstrel.c
> +++ b/net/mac80211/rc80211_minstrel.c
> @@ -181,6 +181,11 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
> if (ar[i].idx < 0)
> break;
>
> + if (WARN(ar[i].idx >= mi->n_rates,
> + "minstrel: invalid rate report %d (n=%d)\n",
> + ar[i].idx, mi->n_rates))
> + break;
It might be easier to print this in hex -- that way things like 0x6b are
more apparent?
johannes
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists