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

Johannes Berg
2009-05-04T16:07:48Z

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]