Skip to content

Commit

Permalink
[NETFILTER]: Wait until all references to ip_conntrack_untracked are …
Browse files Browse the repository at this point in the history
…dropped on unload

Fixes a crash when unloading ip_conntrack.

Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kaber authored and davem330 committed Jul 22, 2005
1 parent d04b4f8 commit 21f930e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/netfilter/ip_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 21f930e

Please sign in to comment.