mlx5: fix possible crash during initialization