[NETFILTER 04/05]: nf_conntrack: add missing unlock in get_next_corpse()

Patrick McHardy kaber at trash.net
Mon Oct 30 19:19:01 CET 2006


[NETFILTER]: nf_conntrack: add missing unlock in get_next_corpse()

Add missing unlock in get_next_corpse() in nf_conntrack. It was missed
during the removal of listhelp.h . Also remove an unneeded use of
nf_ct_tuplehash_to_ctrack() in the same function.

Should be applied before 2.6.19 is released.

Signed-off-by: Martin Josefsson <gandalf at wlug.westbo.se>
Signed-off-by: Patrick McHardy <kaber at trash.net>

---
commit 4de9f9e71c273a4f53f82c5dd3e48f25cb3893f9
tree 7ec3e2872f3820ed76117ea463adab561d9645b9
parent 2e3d7fd325d9327881f17aec50619caaf1aeab00
author Martin Josefsson <gandalf at wlug.westbo.se> Mon, 30 Oct 2006 16:31:19 +0100
committer Patrick McHardy <kaber at trash.net> Mon, 30 Oct 2006 16:31:19 +0100

 net/netfilter/nf_conntrack_core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 093b3dd..836541e 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1520,9 +1520,10 @@ get_next_corpse(int (*iter)(struct nf_co
 		if (iter(ct, data))
 			goto found;
 	}
+	write_unlock_bh(&nf_conntrack_lock);
 	return NULL;
 found:
-	atomic_inc(&nf_ct_tuplehash_to_ctrack(h)->ct_general.use);
+	atomic_inc(&ct->ct_general.use);
 	write_unlock_bh(&nf_conntrack_lock);
 	return ct;
 }



More information about the netfilter-devel mailing list