Skip to content

Commit 9a4d6dd

Browse files
Tetsuo HandaFlorian Westphal
authored andcommitted
netfilter: nf_tables: fix percpu memory leak at nf_tables_addchain()
It seems to me that percpu memory for chain stats started leaking since commit 3bc158f ("netfilter: nf_tables: map basechain priority to hardware priority") when nft_chain_offload_priority() returned an error. Signed-off-by: Tetsuo Handa <[email protected]> Fixes: 3bc158f ("netfilter: nf_tables: map basechain priority to hardware priority") Signed-off-by: Florian Westphal <[email protected]>
1 parent 921ebde commit 9a4d6dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 genmask,
22432243
if (err < 0) {
22442244
nft_chain_release_hook(&hook);
22452245
kfree(basechain);
2246+
free_percpu(stats);
22462247
return err;
22472248
}
22482249
if (stats)

0 commit comments

Comments
 (0)