[PATCH 6.16 173/627] net/mlx5: Check device memory pointer before usage