> -----Original Message-----
> From: Yu, DapengX <[email protected]>
> Sent: Thursday, April 29, 2021 8:06 AM
> To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian
> <[email protected]>
> Cc: [email protected]; Yu, DapengX <[email protected]>; [email protected]
> Subject: [PATCH] net/softnic: initialize meter policy list before use
>
> From: Dapeng Yu <[email protected]>
>
> Initialize meter policy list before use to avoid segment fault
>
> Fixes: 0d73ddf25faa ("net/softnic: add meter profile")
> Cc: [email protected]
>
> Signed-off-by: Dapeng Yu <[email protected]>
> ---
> 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 <[email protected]>