From: Alexey Dobriyan Date: Tue, 4 Nov 2008 13:28:04 +0000 (+0100) Subject: netfilter: netns ebtables: more cleanup during ebt_unregister_table() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dbcdf85a2e3d2aa584dafd10b5a1f42764e673e7;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git netfilter: netns ebtables: more cleanup during ebt_unregister_table() Now that ebt_unregister_table() can be called during netns stop, and module pinning scheme can't prevent netns stop, do table cleanup by hand. Signed-off-by: Alexey Dobriyan Signed-off-by: Patrick McHardy --- diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 82e17527e21e..fa108c46e851 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -1209,6 +1209,10 @@ void ebt_unregister_table(struct ebt_table *table) mutex_lock(&ebt_mutex); list_del(&table->list); mutex_unlock(&ebt_mutex); + EBT_ENTRY_ITERATE(table->private->entries, table->private->entries_size, + ebt_cleanup_entry, NULL); + if (table->private->nentries) + module_put(table->me); vfree(table->private->entries); if (table->private->chainstack) { for_each_possible_cpu(i)