Web lists-archives.com

Re: [PATCH] qed: fix kzalloc-simple.cocci warnings




From: kbuild test robot <fengguang.wu@xxxxxxxxx>
Date: Fri, 21 Apr 2017 08:20:07 +0800

> drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1267:13-20: WARNING: kzalloc should be used for dcbx_info, instead of kmalloc/memset
> 
> 
>  Use kzalloc rather than kmalloc followed by memset with 0
> 
>  This considers some simple cases that are common and easy to validate
>  Note in particular that there are no ...s in the rule, so all of the
>  matched code has to be contiguous
> 
> Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
> 
> CC: sudarsana.kalluru@xxxxxxxxxx <sudarsana.kalluru@xxxxxxxxxx>
> Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>

I intentionally let this change happen.

It was less risky than asking the submitter who introduced it to
make another respin to keep the kzalloc().