Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5: E-Switch, Fix an Oops in error handling code
@ 2023-02-27 11:16 Dan Carpenter
  2023-02-27 18:13 ` Roi Dayan
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-02-27 11:16 UTC (permalink / raw)
  To: Vu Pham
  Cc: Leon Romanovsky, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Roi Dayan, Maor Dickman, Mark Bloch, Parav Pandit,
	Vu Pham, netdev, linux-rdma, kernel-janitors

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 <error27@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
index d55775627a47..50d2ea323979 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
@@ -364,8 +364,7 @@ int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vpo
 
 	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);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net/mlx5: E-Switch, Fix an Oops in error handling code
  2023-02-27 11:16 [PATCH net] net/mlx5: E-Switch, Fix an Oops in error handling code Dan Carpenter
@ 2023-02-27 18:13 ` Roi Dayan
  0 siblings, 0 replies; 2+ messages in thread
From: Roi Dayan @ 2023-02-27 18:13 UTC (permalink / raw)
  To: Dan Carpenter, Vu Pham
  Cc: Leon Romanovsky, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Maor Dickman, Mark Bloch, Parav Pandit, netdev,
	linux-rdma, kernel-janitors



On 27/02/2023 13:16, Dan Carpenter wrote:
> 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 <error27@gmail.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
> index d55775627a47..50d2ea323979 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c
> @@ -364,8 +364,7 @@ int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vpo
>  
>  	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);

thanks

Reviewed-by: Roi Dayan <roid@nvidia.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-27 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 11:16 [PATCH net] net/mlx5: E-Switch, Fix an Oops in error handling code Dan Carpenter
2023-02-27 18:13 ` Roi Dayan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox