netfilter: nf_tables: use kfree_rcu(ptr, rcu) to release hooks in clean_net path

[ Upstream commit ab5e5c062f ]

Use kfree_rcu(ptr, rcu) variant instead as described by ae089831ff
("netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant").

Fixes: f9a43007d3 ("netfilter: nf_tables: double hook unregistration in netns path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Pablo Neira Ayuso 2022-06-01 16:00:00 +02:00 committed by Greg Kroah-Hartman
parent bf65364cd7
commit 73629859a9

View File

@ -7231,7 +7231,7 @@ static void __nft_unregister_flowtable_net_hooks(struct net *net,
nf_unregister_net_hook(net, &hook->ops);
if (release_netdev) {
list_del(&hook->list);
kfree_rcu(hook);
kfree_rcu(hook, rcu);
}
}
}