[NETFILTER]: Wait until all references to ip_conntrack_untracked are dropped on unload
authorPatrick McHardy <kaber@trash.net>
Fri, 22 Jul 2005 19:51:03 +0000 (12:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Jul 2005 19:51:03 +0000 (12:51 -0700)
Fixes a crash when unloading ip_conntrack.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_conntrack_core.c

index 14af55c..63bf882 100644 (file)
@@ -1107,6 +1107,9 @@ void ip_conntrack_cleanup(void)
                schedule();
                goto i_see_dead_people;
        }
+       /* wait until all references to ip_conntrack_untracked are dropped */
+       while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)
+               schedule();
 
        kmem_cache_destroy(ip_conntrack_cachep);
        kmem_cache_destroy(ip_conntrack_expect_cachep);