net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable
authorPaul Blakey <paulb@nvidia.com>
Mon, 25 Jan 2021 15:31:26 +0000 (17:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:50 +0000 (23:28 +0100)
commit17dbec01beb9fc5cb96cf44f5d07d558a350aced
tree486e06e52fb5ddb56c31305c4ccbcd4b3662543c
parentf5430661f2f718e36181e47e4b15654b615d9d39
net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable

[ Upstream commit e2194a1744e8594e82a861687808c1adca419b85 ]

If a non nat tuple entry is inserted just to the regular tuples
rhashtable (ct_tuples_ht) and not to natted tuples rhashtable
(ct_nat_tuples_ht). Commit bc562be9674b ("net/mlx5e: CT: Save ct entries
tuples in hashtables") mixed up the return labels and names sot that on
cleanup or failure we still try to remove for the natted tuples rhashtable.

Fix that by correctly checking if a natted tuples insertion
before removing it. While here make it more readable.

Fixes: bc562be9674b ("net/mlx5e: CT: Save ct entries tuples in hashtables")
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c