Skip to content

Commit

Permalink
net/mlx5: E-Switch, Fix an Oops in error handling code
Browse files Browse the repository at this point in the history
[ Upstream commit 640fcdb ]

The error handling dereferences "vport".  There is nothing we can do if
it is an error pointer except returning the error code.

Fixes: 133dcfc ("net/mlx5: E-Switch, Alloc and free unique metadata for match")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
error27 authored and gregkh committed Mar 30, 2023
1 parent fba0b70 commit c4c9779
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -364,8 +364,7 @@ int mlx5_esw_acl_ingress_vport_bond_update(struct mlx5_eswitch *esw, u16 vport_n

if (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);
Expand Down

0 comments on commit c4c9779

Please sign in to comment.