net/mlx5: fix destroying empty matchers list
authorAdham Masarwah <adham@nvidia.com>
Wed, 23 Feb 2022 09:32:05 +0000 (11:32 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 1 Mar 2022 21:24:36 +0000 (22:24 +0100)
commitdc065d6efdf1cabe042944aac457fa19235ad632
tree6aefbd7019de02c55561edee15c836a29a050db0
parent7bc528bac95a00e2462ae76b1f9e8610d4d67477
net/mlx5: fix destroying empty matchers list

The table remove callback function is trying to destroy the
matchers list associated with table entries without checking
if the list is valid, which causes null pointer dereference.
Fixed by validating the matchers list before destroying it.

Issue can be reproduced with testpmd on Windows, when you run:
port close all

Fixes: 1872635570be ("net/mlx5: make matcher list thread safe")
Cc: stable@dpdk.org
Signed-off-by: Adham Masarwah <adham@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
drivers/net/mlx5/mlx5_flow_dv.c