[PATCH v2 2/8] net/nfp: fix calloc parameters
Morten Brørup
mb at smartsharesystems.com
Wed Jan 24 20:01:03 CET 2024
> From: Ferruh Yigit [mailto:ferruh.yigit at amd.com]
> Sent: Wednesday, 24 January 2024 19.54
>
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
>
> [1]
> gcc (GCC) 14.0.0 20231102 (experimental)
>
> [2]
> Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
> .../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
> ../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
> warning: allocation of insufficient size ‘1’ for type
> ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
> 171 | mutex = calloc(sizeof(*mutex), 1);
> | ^
>
> Fixes: c7e9729da6b5 ("net/nfp: support CPP")
> Cc: stable at dpdk.org
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
> Acked-by: Chaoyong He <chaoyong.he at corigine.com>
> ---
Acked-by: Morten Brørup <mb at smartsharesystems.com>
More information about the stable
mailing list