Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d96fc659 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by David S. Miller
Browse files

netfilter: nf_conntrack: fix count leak in error path of __nf_conntrack_alloc



We have to decrement the conntrack counter if we fail to access the
zone extension.

Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee14186f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -735,6 +735,7 @@ __nf_conntrack_alloc(struct net *net, u16 zone,

#ifdef CONFIG_NF_CONNTRACK_ZONES
out_free:
	atomic_dec(&net->ct.count);
	kmem_cache_free(net->ct.nf_conntrack_cachep, ct);
	return ERR_PTR(-ENOMEM);
#endif