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>
return 0;
hrxq = container_of(entry, typeof(*hrxq), entry);
}
- return hrxq->idx;
+ if (hrxq)
+ return hrxq->idx;
+ return 0;
}
/**