net/mlx5: fix possible NULL dereference in Rx path
net/mlx5: fix possible NULL dereference in Rx path

The user is allowed to call ->rx_pkt_burst() even without free
mbufs in the pool. In this scenario we'll fail allocating a rep mbuf
on the first iteration (where pkt is still NULL). This would cause us
to deref a NULL pkt (reset refcount and free).

Fix this by checking the pkt before freeing it.

Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx")

Signed-off-by: Sagi Grimberg <bf169a711b430cb763859053627bb76d98a96051@grimberg.me>
Acked-by: Adrien Mazarguil <9d39ea493ca46c560334f650ac5d4b5ffbcb5cf0@6wind.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk