diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-04-03 10:45:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-03 19:20:30 -0400 |
commit | d96fc659aeb27686cef42d305cfd0c9702f8841c (patch) | |
tree | e021455bc7c25a1dfc80360b05caf5bc55dc68ae /net | |
parent | ee14186f8d2338227888f3c00a06caf31f94de38 (diff) |
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: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index cbdb754dbb10..3cc4487ac349 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -735,6 +735,7 @@ __nf_conntrack_alloc(struct net *net, u16 zone, | |||
735 | 735 | ||
736 | #ifdef CONFIG_NF_CONNTRACK_ZONES | 736 | #ifdef CONFIG_NF_CONNTRACK_ZONES |
737 | out_free: | 737 | out_free: |
738 | atomic_dec(&net->ct.count); | ||
738 | kmem_cache_free(net->ct.nf_conntrack_cachep, ct); | 739 | kmem_cache_free(net->ct.nf_conntrack_cachep, ct); |
739 | return ERR_PTR(-ENOMEM); | 740 | return ERR_PTR(-ENOMEM); |
740 | #endif | 741 | #endif |