Re: [patch] UBIFS: use kmalloc_array() in recomp_data_node()

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

 



On Sat, 2012-11-17 at 18:11 +0300, Dan Carpenter wrote:
>  	out_len = le32_to_cpu(dn->size);
> -	buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
> +	buf = kmalloc_array(out_len, WORST_COMPR_FACTOR, GFP_NOFS);
>  	if (!buf)
>  		return -ENOMEM;

I think this makes the code unreadable, because we really allocate a
buffer, not an array.

-- 
Best Regards,
Artem Bityutskiy

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


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux