net/mlx5: Fix leak upon failure of rule creation
authorMaor Gottlieb <maorg@nvidia.com>
Wed, 20 Jan 2021 15:41:18 +0000 (17:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:29:14 +0000 (09:29 +0100)
commit11c2c8fb889d6ee61f268810175818d05ae0323b
tree8e2fecc721ccb6cac42fcf186f8b00dd2af53c6c
parentada342012b2d703d3e409103f11f817b47ab56e5
net/mlx5: Fix leak upon failure of rule creation

[ Upstream commit a5bfe6b4675e0eefbd9418055b5cc6e89af27eb4 ]

When creation of a new rule that requires allocation of an FTE fails,
need to call to tree_put_node on the FTE in order to release its'
resource.

Fixes: cefc23554fc2 ("net/mlx5: Fix FTE cleanup")
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Reviewed-by: Alaa Hleihel <alaa@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c