* [PATCH] netfilter: x_tables: xt_free_table_info() cleanup
@ 2014-06-24 9:15 Eric Dumazet
2014-06-25 12:55 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2014-06-24 9:15 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
From: Eric Dumazet <edumazet@google.com>
kvfree() helper can make xt_free_table_info() much cleaner.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/netfilter/x_tables.c | 23 +++++------------------
1 file 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)
{
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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: x_tables: xt_free_table_info() cleanup
2014-06-24 9:15 [PATCH] netfilter: x_tables: xt_free_table_info() cleanup Eric Dumazet
@ 2014-06-25 12:55 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2014-06-25 12:55 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netfilter-devel
On Tue, Jun 24, 2014 at 02:15:35AM -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> kvfree() helper can make xt_free_table_info() much cleaner.
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-25 12:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 9:15 [PATCH] netfilter: x_tables: xt_free_table_info() cleanup Eric Dumazet
2014-06-25 12:55 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).