From 04e64d85250b6ccb8b976a256662e089f41134cd Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Thu, 31 Jan 2008 04:05:34 -0800 Subject: [PATCH] --- yaml --- r: 81901 b: refs/heads/master c: df200969b1627e8f1cda7ce8c0707863f91bb81b h: refs/heads/master i: 81899: 78621cb3bdc19e5dbe65c7fd9983ae04409d3e50 v: v3 --- [refs] | 2 +- trunk/net/ipv4/netfilter/arp_tables.c | 3 +++ trunk/net/ipv4/netfilter/ip_tables.c | 3 +++ trunk/net/ipv6/netfilter/ip6_tables.c | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 42b02fc3a2f3..b8b31392d0c9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ea0cb2601c4747dff758a9a7a5a4a433ad527f3 +refs/heads/master: df200969b1627e8f1cda7ce8c0707863f91bb81b diff --git a/trunk/net/ipv4/netfilter/arp_tables.c b/trunk/net/ipv4/netfilter/arp_tables.c index ec64b679641d..3608675ab08c 100644 --- a/trunk/net/ipv4/netfilter/arp_tables.c +++ b/trunk/net/ipv4/netfilter/arp_tables.c @@ -1773,6 +1773,7 @@ void arpt_unregister_table(struct arpt_table *table) { struct xt_table_info *private; void *loc_cpu_entry; + struct module *table_owner = table->me; private = xt_unregister_table(table); @@ -1780,6 +1781,8 @@ void arpt_unregister_table(struct arpt_table *table) loc_cpu_entry = private->entries[raw_smp_processor_id()]; ARPT_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); + if (private->number > private->initial_entries) + module_put(table_owner); xt_free_table_info(private); } diff --git a/trunk/net/ipv4/netfilter/ip_tables.c b/trunk/net/ipv4/netfilter/ip_tables.c index c1b80f4cb7cc..427bc9b3d342 100644 --- a/trunk/net/ipv4/netfilter/ip_tables.c +++ b/trunk/net/ipv4/netfilter/ip_tables.c @@ -2095,12 +2095,15 @@ void ipt_unregister_table(struct xt_table *table) { struct xt_table_info *private; void *loc_cpu_entry; + struct module *table_owner = table->me; private = xt_unregister_table(table); /* Decrease module usage counts and free resources */ loc_cpu_entry = private->entries[raw_smp_processor_id()]; IPT_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); + if (private->number > private->initial_entries) + module_put(table_owner); xt_free_table_info(private); } diff --git a/trunk/net/ipv6/netfilter/ip6_tables.c b/trunk/net/ipv6/netfilter/ip6_tables.c index 2453dfdc91aa..6fabb73ff445 100644 --- a/trunk/net/ipv6/netfilter/ip6_tables.c +++ b/trunk/net/ipv6/netfilter/ip6_tables.c @@ -2121,12 +2121,15 @@ void ip6t_unregister_table(struct xt_table *table) { struct xt_table_info *private; void *loc_cpu_entry; + struct module *table_owner = table->me; private = xt_unregister_table(table); /* Decrease module usage counts and free resources */ loc_cpu_entry = private->entries[raw_smp_processor_id()]; IP6T_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, NULL); + if (private->number > private->initial_entries) + module_put(table_owner); xt_free_table_info(private); }