Search Linux Wireless

Re: [patch] wireless: at76c50x: allocating too much data

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

 



Dan Carpenter <dan.carpenter@xxxxxxxxxx> writes:

> On Fri, Apr 20, 2012 at 06:57:00PM +1000, Julian Calaby wrote:
>> > -       struct mib_local *m = kmalloc(sizeof(struct mib_phy), GFP_KERNEL);
>> > +       struct mib_local *m = kmalloc(sizeof(struct mib_local), GFP_KERNEL);
>> 
>> Would it be better practice to use sizeof(*m)?
>> 
>
> That was my temptation as well...  But I decided to make it match
> with the surrounding code.  I'm happy to resend if people want.

IMHO sizeof(*m) is better and I tend to use it.

Related to this: I have a bad habit of sometimes dropping '*' from
sizeof()? Is there a tool which could spot that?

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