[dpdk-dev] [PATCH] net/softnic: initialize meter policy list before use

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Thu Apr 29 09:48:38 CEST 2021



> -----Original Message-----
> From: Yu, DapengX <dapengx.yu at intel.com>
> Sent: Thursday, April 29, 2021 8:06 AM
> To: Singh, Jasvinder <jasvinder.singh at intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu at intel.com>
> Cc: dev at dpdk.org; Yu, DapengX <dapengx.yu at intel.com>; stable at dpdk.org
> Subject: [PATCH] net/softnic: initialize meter policy list before use
> 
> From: Dapeng Yu <dapengx.yu at intel.com>
> 
> Initialize meter policy list before use to avoid segment fault
> 
> Fixes: 0d73ddf25faa ("net/softnic: add meter profile")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Dapeng Yu <dapengx.yu at intel.com>
> ---
>  drivers/net/softnic/rte_eth_softnic_meter.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c
> b/drivers/net/softnic/rte_eth_softnic_meter.c
> index acb8b87fd..5831892a3 100644
> --- a/drivers/net/softnic/rte_eth_softnic_meter.c
> +++ b/drivers/net/softnic/rte_eth_softnic_meter.c
> @@ -17,6 +17,9 @@ softnic_mtr_init(struct pmd_internals *p)
>  	/* Initialize meter profiles list */
>  	TAILQ_INIT(&p->mtr.meter_profiles);
> 
> +	/* Initialize meter policies list */
> +	TAILQ_INIT(&p->mtr.meter_policies);
> +
>  	/* Initialize MTR objects list */
>  	TAILQ_INIT(&p->mtr.mtrs);
> 
> --
> 2.27.0

Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>



More information about the dev mailing list