net/mlx5: check attr pointer validity before dereferencing it
authorAriel Levkovich <lariel@nvidia.com>
Tue, 16 Aug 2022 20:19:11 +0000 (23:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:29 +0000 (11:58 +0100)
commit39124c14af45b4c0b393c9d271697b17721ad84b
tree780514b07d24b80e52ad14db28bab267ce554c82
parent7697de4ad708099cda1427aff4a73af1a25ab162
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>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c