From: Paul Blakey Date: Thu, 30 Sep 2021 11:23:32 +0000 (+0300) Subject: net/mlx5: CT: Fix missing cleanup of ct nat table on init failure X-Git-Tag: v6.1-rc5~2768^2~181^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88594d83314ad06314c9743b1ec49d0a95a5d4c7;p=platform%2Fkernel%2Flinux-starfive.git net/mlx5: CT: Fix missing cleanup of ct nat table on init failure If CT fails to initialize it's rhashtables, it doesn't destroy the ct nat global table. Destroy the ct nat global table on ct init failure. Fixes: d7cade513752 ("net/mlx5e: check return value of rhashtable_init") Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index 225748a..740cd6f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -2141,6 +2141,7 @@ err_ct_tuples_nat_ht: err_ct_tuples_ht: rhashtable_destroy(&ct_priv->zone_ht); err_ct_zone_ht: + mlx5_chains_destroy_global_table(chains, ct_priv->ct_nat); err_ct_nat_tbl: mlx5_chains_destroy_global_table(chains, ct_priv->ct); err_ct_tbl: