Skip to content

Commit

Permalink
[NETFILTER]: ip6_tables: use vmalloc_node()
Browse files Browse the repository at this point in the history
Consistently use vmalloc_node for all counter allocations.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 28, 2008
1 parent f173c8a commit 3b84e92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ copy_entries_to_user(unsigned int total_size,
(other than comefrom, which userspace doesn't care
about). */
countersize = sizeof(struct xt_counters) * private->number;
counters = vmalloc(countersize);
counters = vmalloc_node(countersize, numa_node_id());

if (counters == NULL)
return -ENOMEM;
Expand Down Expand Up @@ -1080,7 +1080,8 @@ do_replace(void __user *user, unsigned int len)
goto free_newinfo;
}

counters = vmalloc(tmp.num_counters * sizeof(struct xt_counters));
counters = vmalloc_node(tmp.num_counters * sizeof(struct xt_counters),
numa_node_id());
if (!counters) {
ret = -ENOMEM;
goto free_newinfo;
Expand Down Expand Up @@ -1186,7 +1187,7 @@ do_add_counters(void __user *user, unsigned int len)
if (len != sizeof(tmp) + tmp.num_counters*sizeof(struct xt_counters))
return -EINVAL;

paddc = vmalloc(len);
paddc = vmalloc_node(len, numa_node_id());
if (!paddc)
return -ENOMEM;

Expand Down

0 comments on commit 3b84e92

Please sign in to comment.