From: Xueming Li Date: Tue, 12 Jun 2018 11:38:11 +0000 (+0800) Subject: net/mlx5: fix crash in device probe X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a9fc0b0ef0c276fcea082b20574e27cca1bac3e8;p=dpdk.git net/mlx5: fix crash in device probe This patch initializes counter descriptor struct before invoking Verbs api to avoid segmentation fault. Fixes: 9a761de8ea14 ("net/mlx5: flow counter support") Cc: stable@dpdk.org Signed-off-by: Xueming Li Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index d27ee960db..3e0a1b1869 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -672,7 +672,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, int i; struct mlx5dv_context attrs_out = {0}; #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT - struct ibv_counter_set_description cs_desc; + struct ibv_counter_set_description cs_desc = { .counter_type = 0 }; #endif /* Prepare shared data between primary and secondary process. */