net/mlx5: fix memory region cache lookup
net/mlx5: fix memory region cache lookup

The Memory Region (MR) cache contains pointers to mlx5_mr.
The MR cache indexes are filled when a new MR is created. As it is
possible for MR to be created on the flight, an extra validation must be
added to avoid segmentation fault.

Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <a578f76ca98b1dec92e0d1baef814b93f3f2f3b4@mellanox.com>
Signed-off-by: Shahaf Shuler <59427d49da6f2b944fbf4cb5ee70ef3ac25f744f@mellanox.com>
Acked-by: Nelio Laranjeiro <2f8dd9032d5b85ca4b53dec8ce664eb6998836be@6wind.com>

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