[PATCH v2 1/8] pipeline: fix calloc parameters

Morten Brørup mb at smartsharesystems.com
Wed Jan 24 20:00:33 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 .../pipeline_rte_swx_pipeline_spec.c.o
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
>  2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
>       |           ^
> 
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
>  4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
>       |           ^
> 
> Fixes: 30c4abb90942 ("pipeline: rework specification file-based
> pipeline build")
> Fixes: 54cae37ef4ef ("pipeline: support I/O specification")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
> ---

Acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the stable mailing list