aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-09-10 10:49:37 +0200
committerTejun Heo <tj@kernel.org>2010-09-10 10:56:24 +0200
commitfc1481a956181d0360d3eb129965302489895a1b (patch)
tree425b30a6acc526067a2754840d95ddefed780166 /mm
parent3c9a024fde58b08745680863859d1483def64f74 (diff)
percpu: clear memory allocated with the km allocator
Percpu allocator should clear memory before returning it but the km allocator forgot to do it. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/percpu-km.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index 7037bc73bfa..89633fefc6a 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -35,7 +35,11 @@
static int pcpu_populate_chunk(struct pcpu_chunk *chunk, int off, int size)
{
- /* noop */
+ unsigned int cpu;
+
+ for_each_possible_cpu(cpu)
+ memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size);
+
return 0;
}