net/mlx5: E-Switch, Fix an Oops in error handling code
Subsystems (5)
PATCH 1/1 net/mlx5: E-Switch, Fix an Oops in error handling code
The error handling dereferences "vport". There is nothing we can do if it is an error pointer except returning the error code.
Fixes 133dcfc577ea ("net/mlx5: E-Switch, Alloc and free unique metadata for match")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +1 -2
@@ -364,8 +364,7 @@ int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vpoif (WARN_ON_ONCE (IS_ERR (vport))) {esw_warn (esw->dev,"vport(%d) invalid!\n" , vport_num); - err =PTR_ERR (vport); - goto out; +return PTR_ERR (vport); }esw_acl_ingress_ofld_rules_destroy (esw, vport);
Signature · 1 line
2.39.1
Quoted 14 lines · Dan Carpenter
The error handling dereferences "vport". There is nothing we can do if it is an error pointer except returning the error code.
Fixes 133dcfc577ea ("net/mlx5: E-Switch, Alloc and free unique metadata for match")Signed-off-by Dan Carpenter <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +0
-0
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vpo · line 370
Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +1
-2@@ -364,8 +364,7 @@ int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vpoif (WARN_ON_ONCE (IS_ERR (vport))) {esw_warn (esw->dev,"vport(%d) invalid!\n" , vport_num); - err =PTR_ERR (vport); - goto out; +return PTR_ERR (vport); }esw_acl_ingress_ofld_rules_destroy (esw, vport);
thanks
Reviewed-by Roi Dayan <[email protected]>