Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 16:41:21 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347786 - stable/12/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161641.x4GGfLeo078685@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 16:41:21 2019
New Revision: 347786
URL: https://svnweb.freebsd.org/changeset/base/347786

Log:
  MFC r347321:
  Undo previous steps upon returning failure in mlx5en(4).
  
  Else flowtable resources may not be properly freed.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Thu May 16 16:40:47 2019	(r347785)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Thu May 16 16:41:21 2019	(r347786)
@@ -633,7 +633,11 @@ mlx5e_add_any_vid_rules(struct mlx5e_priv *priv)
 	if (err)
 		return (err);
 
-	return (mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0));
+	err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0);
+	if (err)
+		mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_CTAG_VID, 0);
+
+	return (err);
 }
 
 void
@@ -701,19 +705,22 @@ mlx5e_add_all_vlan_rules(struct mlx5e_priv *priv)
 		err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_VID,
 					  i);
 		if (err)
-			return (err);
+			goto error;
 	}
 
 	err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_UNTAGGED, 0);
 	if (err)
-		return (err);
+		goto error;
 
 	if (priv->vlan.filter_disabled) {
 		err = mlx5e_add_any_vid_rules(priv);
 		if (err)
-			return (err);
+			goto error;
 	}
 	return (0);
+error:
+	mlx5e_del_all_vlan_rules(priv);
+	return (err);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161641.x4GGfLeo078685>