From fc1481a956181d0360d3eb129965302489895a1b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Fri, 10 Sep 2010 10:49:37 +0200 Subject: 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 --- mm/percpu-km.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mm') 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; } -- cgit v1.2.3-70-g09d2