net/mlx5: E-Switch, Use the correct error check on returned pointers