Search Linux Wireless

re: mac80211: correct size the argument to kzalloc in

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

 



minstrel_ht

Hello Thomas Huehn,

The patch 0a08adeb773c: "mac80211: correct size the argument to
kzalloc in minstrel_ht" from Jun 29, 2012, leads to the following
Sparse warning:
	net/mac80211/rc80211_minstrel_ht.c:816:33:
		warning: expression using sizeof(void)

-       msp->ratelist = kzalloc(sizeof(struct minstrel_rate) * max_rates, gfp);
+       msp->ratelist = kzalloc(sizeof(*msp->ratelist) * max_rates, gfp);
        if (!msp->ratelist)
                goto error;

"msp->ratelist" is a void pointer so that will cause memory corruption.
You could consider making it a struct minstrel_rate pointer.  I haven't
looked at this.

regards,
dan carpenter

--
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