summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-09-10 10:49:37 +0200
committerPekka Enberg <penberg@kernel.org>2010-10-02 10:28:42 +0300
commited6c1115c835d822ec5d6356ae3043de54088f43 (patch)
treeb25aa10f14fa60c7444d8ca5fe97c84f12801429
parent9b8327bb2483ded5e04df6c33cf339ce7c02f6e9 (diff)
downloadop-kernel-dev-ed6c1115c835d822ec5d6356ae3043de54088f43.zip
op-kernel-dev-ed6c1115c835d822ec5d6356ae3043de54088f43.tar.gz
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>
-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 7037bc7..89633fe 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;
}
OpenPOWER on IntegriCloud