diff options
Diffstat (limited to 'net/ipv4/netfilter/ip_tables.c')
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index c1b80f4cb7c..427bc9b3d34 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -2095,12 +2095,15 @@ void ipt_unregister_table(struct xt_table *table) | |||
2095 | { | 2095 | { |
2096 | struct xt_table_info *private; | 2096 | struct xt_table_info *private; |
2097 | void *loc_cpu_entry; | 2097 | void *loc_cpu_entry; |
2098 | struct module *table_owner = table->me; | ||
2098 | 2099 | ||
2099 | private = xt_unregister_table(table); | 2100 | private = xt_unregister_table(table); |
2100 | 2101 | ||
2101 | /* Decrease module usage counts and free resources */ | 2102 | /* Decrease module usage counts and free resources */ |
2102 | loc_cpu_entry = private->entries[raw_smp_processor_id()]; | 2103 | loc_cpu_entry = private->entries[raw_smp_processor_id()]; |
2103 | IPT_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); | 2104 | IPT_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); |
2105 | if (private->number > private->initial_entries) | ||
2106 | module_put(table_owner); | ||
2104 | xt_free_table_info(private); | 2107 | xt_free_table_info(private); |
2105 | } | 2108 | } |
2106 | 2109 | ||