Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae08983

Browse files
edumazetummakynes
authored andcommitted
netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant
While kfree_rcu(ptr) _is_ supported, it has some limitations. Given that 99.99% of kfree_rcu() users [1] use the legacy two parameters variant, and @catchall objects do have an rcu head, simply use it. Choice of kfree_rcu(ptr) variant was probably not intentional. [1] including calls from net/netfilter/nf_tables_api.c Fixes: aaa3104 ("netfilter: nftables: add catch-all set element support") Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 277f2bb commit ae08983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4502,7 +4502,7 @@ static void nft_set_catchall_destroy(const struct nft_ctx *ctx,
45024502
list_for_each_entry_safe(catchall, next, &set->catchall_list, list) {
45034503
list_del_rcu(&catchall->list);
45044504
nft_set_elem_destroy(set, catchall->elem, true);
4505-
kfree_rcu(catchall);
4505+
kfree_rcu(catchall, rcu);
45064506
}
45074507
}
45084508

@@ -5669,7 +5669,7 @@ static void nft_setelem_catchall_remove(const struct net *net,
56695669
list_for_each_entry_safe(catchall, next, &set->catchall_list, list) {
56705670
if (catchall->elem == elem->priv) {
56715671
list_del_rcu(&catchall->list);
5672-
kfree_rcu(catchall);
5672+
kfree_rcu(catchall, rcu);
56735673
break;
56745674
}
56755675
}

0 commit comments

Comments
 (0)