net/mlx5: check attr pointer validity before dereferencing it
[ Upstream commit
e0bf81bf0d3d4747c146e0bf44774d3d881d7137 ]
Fix attr pointer validity checks after it was already
dereferenced.
Fixes:
cb0d54cbf948 ("net/mlx5e: Fix wrong source vport matching on tunnel rule")
Signed-off-by: Ariel Levkovich <lariel@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>