net/mlx5: validate hash Rx queue pointer
authorDekel Peled <dekelp@nvidia.com>
Wed, 3 Feb 2021 10:09:09 +0000 (12:09 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Feb 2021 17:44:26 +0000 (18:44 +0100)
commit207b4d06c33896ac723139b3af62bf710ce082f9
tree7beb02403324436636e9c7c65b681ac6b7b76d86
parentae8fdc8067c77496bc07680d42f8aa7f6be34a5b
net/mlx5: validate hash Rx queue pointer

Implementation of mlx5_hrxq_get() tries to get pointer to a hrxq
object, by reusing an existing hrxq, or creating a new one.
There is no check of the obtained pointer, so using it might result
in error.

This patch adds check of the pointer before using it, and return 0
if the pointer is NULL to indicate error.

Fixes: e1592b6c4dea ("net/mlx5: make Rx queue thread safe")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_rxq.c