[Outreachy kernel] [PATCH] staging/rtl8192e: replace kmalloc with kzalloc

Matthew Wilcox willy at infradead.org
Fri Oct 23 11:58:28 UTC 2020


On Fri, Oct 23, 2020 at 03:03:17AM -0700, Elena Afanasova wrote:
> -	txb = kmalloc(sizeof(struct rtllib_txb) + (sizeof(u8 *) * nr_frags),
> -		      gfp_mask);
> +	txb = kzalloc(sizeof(*txb) + (sizeof(u8 *) * nr_frags), gfp_mask);

This would be a good opportunity to use struct_size().



More information about the devel mailing list