aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-06-24 05:15:35 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2014-06-25 08:52:16 -0400
commitf6b50824f7d85f72285c17fec66076a36907089f (patch)
tree712b9e888be9a7bdca484b22c0d7f08ad320b57d /net/netfilter
parent397304b52d9b726a4aed0bf9086612bba429d420 (diff)
netfilter: x_tables: xt_free_table_info() cleanup
kvfree() helper can make xt_free_table_info() much cleaner. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/x_tables.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 227aa11e8409..47b978bc3100 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -711,28 +711,15 @@ void xt_free_table_info(struct xt_table_info *info)
711{ 711{
712 int cpu; 712 int cpu;
713 713
714 for_each_possible_cpu(cpu) { 714 for_each_possible_cpu(cpu)
715 if (info->size <= PAGE_SIZE) 715 kvfree(info->entries[cpu]);
716 kfree(info->entries[cpu]);
717 else
718 vfree(info->entries[cpu]);
719 }
720 716
721 if (info->jumpstack != NULL) { 717 if (info->jumpstack != NULL) {
722 if (sizeof(void *) * info->stacksize > PAGE_SIZE) { 718 for_each_possible_cpu(cpu)
723 for_each_possible_cpu(cpu) 719 kvfree(info->jumpstack[cpu]);
724 vfree(info->jumpstack[cpu]); 720 kvfree(info->jumpstack);
725 } else {
726 for_each_possible_cpu(cpu)
727 kfree(info->jumpstack[cpu]);
728 }
729 } 721 }
730 722
731 if (sizeof(void **) * nr_cpu_ids > PAGE_SIZE)
732 vfree(info->jumpstack);
733 else
734 kfree(info->jumpstack);
735
736 free_percpu(info->stackptr); 723 free_percpu(info->stackptr);
737 724
738 kfree(info); 725 kfree(info);