diff options
author | Eric Dumazet <edumazet@google.com> | 2014-06-24 02:15:35 -0700 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-25 14:52:16 +0200 |
commit | f6b50824f7d85f72285c17fec66076a36907089f (patch) | |
tree | 712b9e888be9a7bdca484b22c0d7f08ad320b57d /net/netfilter/x_tables.c | |
parent | 397304b52d9b726a4aed0bf9086612bba429d420 (diff) | |
download | op-kernel-dev-f6b50824f7d85f72285c17fec66076a36907089f.zip op-kernel-dev-f6b50824f7d85f72285c17fec66076a36907089f.tar.gz |
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/x_tables.c')
-rw-r--r-- | net/netfilter/x_tables.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 227aa11..47b978b 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) { 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); |