git: 2f7e9a8a2136 - main - mlx5: Fix duplicate free of default flow rule in error case.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Tue, 18 Apr 2023 13:02:04 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=2f7e9a8a21367393b613f0f150d49009fa74dd5c

commit 2f7e9a8a21367393b613f0f150d49009fa74dd5c
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2023-04-18 11:17:38 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2023-04-18 13:01:06 +0000

    mlx5: Fix duplicate free of default flow rule in error case.
    
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking
---
 sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c
index e009d403e96c..2bdf01081650 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c
@@ -341,8 +341,6 @@ accel_fs_tcp_destroy_table(struct mlx5e_priv *priv, int i)
 	fs_tcp = &priv->fts.accel_tcp;
 	ft = fs_tcp->tables + i;
 
-	mlx5_del_flow_rule(&fs_tcp->default_rules[i]);
-
 	accel_fs_tcp_destroy_groups(ft);
 	kfree(ft->g);
 	ft->g = NULL;
@@ -358,8 +356,10 @@ mlx5e_accel_fs_tcp_destroy(struct mlx5e_priv *priv)
 	if (!MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ft_field_support.outer_ip_version))
 		return;
 
-	for (i = 0; i < MLX5E_ACCEL_FS_TCP_NUM_TYPES; i++)
+	for (i = 0; i < MLX5E_ACCEL_FS_TCP_NUM_TYPES; i++) {
+		mlx5_del_flow_rule(&priv->fts.accel_tcp.default_rules[i]);
 		accel_fs_tcp_destroy_table(priv, i);
+	}
 }
 
 int