Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbcdf85a authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Patrick McHardy
Browse files

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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 6beceee5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1209,6 +1209,10 @@ void ebt_unregister_table(struct ebt_table *table)
	mutex_lock(&ebt_mutex);
	mutex_lock(&ebt_mutex);
	list_del(&table->list);
	list_del(&table->list);
	mutex_unlock(&ebt_mutex);
	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);
	vfree(table->private->entries);
	if (table->private->chainstack) {
	if (table->private->chainstack) {
		for_each_possible_cpu(i)
		for_each_possible_cpu(i)