netfilter: nf_tables: fix percpu memory leak at nf_tables_addchain()
[ Upstream commit 9a4d6dd554b86e65581ef6b6638a39ae079b17ac ] It seems to me that percpu memory for chain stats started leaking since commit 3bc158f8d0330f0a ("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: 3bc158f8d0330f0a ("netfilter: nf_tables: map basechain priority to hardware priority") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
91aa52652f
commit
08d7524f36
@ -2148,6 +2148,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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user