From: Tejun Heo Date: Fri, 10 Sep 2010 08:49:37 +0000 (+0200) Subject: percpu: clear memory allocated with the km allocator X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ed6c1115c835d822ec5d6356ae3043de54088f43;p=linux.git 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 Reported-by: Peter Zijlstra Acked-by: Peter Zijlstra --- diff --git a/mm/percpu-km.c b/mm/percpu-km.c index 7037bc73bfa42..89633fefc6a2b 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; }