Skip to content

Commit

Permalink
percpu: clear memory allocated with the km allocator
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
htejun committed Sep 10, 2010
1 parent 3c9a024 commit fc1481a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm/percpu-km.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fc1481a

Please sign in to comment.