netfilter: x_tables: xt_free_table_info() cleanup
authorEric Dumazet <edumazet@google.com>
Tue, 24 Jun 2014 09:15:35 +0000 (02:15 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 25 Jun 2014 12:52:16 +0000 (14:52 +0200)
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>
net/netfilter/x_tables.c

index 227aa11e8409bb18be93c0c432a4d71cfb6e8f38..47b978bc310039626232525ee08849df56e909ca 100644 (file)
@@ -711,28 +711,15 @@ void xt_free_table_info(struct xt_table_info *info)
 {
        int cpu;
 
-       for_each_possible_cpu(cpu) {
-               if (info->size <= PAGE_SIZE)
-                       kfree(info->entries[cpu]);
-               else
-                       vfree(info->entries[cpu]);
-       }
+       for_each_possible_cpu(cpu)
+               kvfree(info->entries[cpu]);
 
        if (info->jumpstack != NULL) {
-               if (sizeof(void *) * info->stacksize > PAGE_SIZE) {
-                       for_each_possible_cpu(cpu)
-                               vfree(info->jumpstack[cpu]);
-               } else {
-                       for_each_possible_cpu(cpu)
-                               kfree(info->jumpstack[cpu]);
-               }
+               for_each_possible_cpu(cpu)
+                       kvfree(info->jumpstack[cpu]);
+               kvfree(info->jumpstack);
        }
 
-       if (sizeof(void **) * nr_cpu_ids > PAGE_SIZE)
-               vfree(info->jumpstack);
-       else
-               kfree(info->jumpstack);
-
        free_percpu(info->stackptr);
 
        kfree(info);