Re: [PATCH 2/2] mac80211: pid, fix memory corruption

From: Johannes Berg
Date: Mon May 04 2009 - 12:08:05 EST


On Mon, 2009-05-04 at 18:04 +0200, Jiri Slaby wrote:

> + for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
> + sband = hw->wiphy->bands[i];
> + if (sband->n_bitrates > max_rates)
> + max_rates = sband->n_bitrates;
> + }
> +
> /* We can safely assume that sband won't change unless we get
> * reinitialized. */
> - rinfo = kmalloc(sizeof(*rinfo) * sband->n_bitrates, GFP_ATOMIC);
> + rinfo = kmalloc(sizeof(*rinfo) * max_rates, GFP_ATOMIC);

I suppose you should remove the comment...

johannes

Attachment: signature.asc
Description: This is a digitally signed message part