Skip to content

Commit

Permalink
netfilter: nf_tables: fix percpu memory leak at nf_tables_addchain()
Browse files Browse the repository at this point in the history
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 <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 3bc158f ("netfilter: nf_tables: map basechain priority to hardware priority")
Signed-off-by: Florian Westphal <fw@strlen.de>
  • Loading branch information
Tetsuo Handa authored and Florian Westphal committed Sep 20, 2022
1 parent 921ebde commit 9a4d6dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 genmask,
if (err < 0) {
nft_chain_release_hook(&hook);
kfree(basechain);
free_percpu(stats);
return err;
}
if (stats)
Expand Down

0 comments on commit 9a4d6dd

Please sign in to comment.