net/mlx5: fix crash in device probe

This patch initializes counter descriptor struct before invoking Verbs
api to avoid segmentation fault.

Fixes: 9a761de8ea ("net/mlx5: flow counter support")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
Xueming Li 2018-06-12 19:38:11 +08:00 committed by Shahaf Shuler
parent 93068a9d5a
commit a9fc0b0ef0

View File

@ -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. */