Search Linux Wireless

Re: [PATCH v2] mac80211: correct size the argument to kzalloc in minstrel_ht

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2012-06-29 at 06:26 -0700, Thomas Huehn wrote:
> msp has type struct minstrel_ht_sta_priv not struct minstrel_ht_sta.
> 
> Signed-off-by: Thomas Huehn <thomas@xxxxxxxxxxxxxxxxxxxxxxx>

Acked-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

I guess it worked anyway because the allocations are usually rounded up.

> ---
> Use suggested coding style. Thx to Schrober.
> ---
>  net/mac80211/rc80211_minstrel_ht.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 2d1acc6..1ca8f2b 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -809,11 +809,11 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
>  			max_rates = sband->n_bitrates;
>  	}
>  
> -	msp = kzalloc(sizeof(struct minstrel_ht_sta), gfp);
> +	msp = kzalloc(sizeof(*msp), gfp);
>  	if (!msp)
>  		return NULL;
>  
> -	msp->ratelist = kzalloc(sizeof(struct minstrel_rate) * max_rates, gfp);
> +	msp->ratelist = kzalloc(sizeof(*msp->ratelist) * max_rates, gfp);
>  	if (!msp->ratelist)
>  		goto error;
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux