net/mlx5: fs, delete the FTE when there are no rules attached to it
authorMark Bloch <mbloch@nvidia.com>
Tue, 15 Mar 2022 11:23:40 +0000 (11:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:35 +0000 (10:22 +0200)
commit77d7fb14890f4dbea2c863d00d52c9946145d93e
treeeb09c7e71d44a66f1de40d9563d505616a2346bd
parent87402434ea841699507263a7c8249c383c6b7baf
net/mlx5: fs, delete the FTE when there are no rules attached to it

[ Upstream commit 7b0c6338597613f465d131bd939a51844a00455a ]

When an FTE has no children is means all the rules where removed
and the FTE can be deleted regardless of the dests_size value.
While dests_size should be 0 when there are no children
be extra careful not to leak memory or get firmware syndrome
if the proper bookkeeping of dests_size wasn't done.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@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