Commit e0bf81bf authored by Ariel Levkovich's avatar Ariel Levkovich Committed by Saeed Mahameed

net/mlx5: check attr pointer validity before dereferencing it

Fix attr pointer validity checks after it was already
dereferenced.

Fixes: cb0d54cb ("net/mlx5e: Fix wrong source vport matching on tunnel rule")
Signed-off-by: default avatarAriel Levkovich <lariel@nvidia.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 17b3222e
......@@ -143,7 +143,7 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw,
if (mlx5_esw_indir_table_decap_vport(attr))
vport = mlx5_esw_indir_table_decap_vport(attr);
if (attr && !attr->chain && esw_attr->int_port)
if (!attr->chain && esw_attr && esw_attr->int_port)
metadata =
mlx5e_tc_int_port_get_metadata_for_match(esw_attr->int_port);
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment