net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release
authorPaul Blakey <paulb@nvidia.com>
Tue, 29 Mar 2022 14:42:46 +0000 (17:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:30:13 +0000 (12:30 +0200)
commitd9b4965d24012eda91d88437945bbeca1ebc429c
tree367d26b504d76df682e50d6a066acc20a12d9de5
parent32d9ad28dcda6fc08d3b0a2978fca82718ef8b0f
net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release

commit b069e14fff46c8da9fcc79957f8acaa3e2dfdb6b upstream.

__mlx5_tc_ct_entry_put() queues release of tuple related to some ct FT,
if that is the last reference to that tuple, the actual deletion of
the tuple can happen after the FT is already destroyed and freed.

Flush the used workqueue before destroying the ct FT.

Fixes: a2173131526d ("net/mlx5e: CT: manage the lifetime of the ct entry object")
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c