Commit fc1481a956181d0360d3eb129965302489895a1b
1 parent
3c9a024fde
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
mm/percpu-km.c
... | ... | @@ -35,7 +35,11 @@ |
35 | 35 | |
36 | 36 | static int pcpu_populate_chunk(struct pcpu_chunk *chunk, int off, int size) |
37 | 37 | { |
38 | - /* noop */ | |
38 | + unsigned int cpu; | |
39 | + | |
40 | + for_each_possible_cpu(cpu) | |
41 | + memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size); | |
42 | + | |
39 | 43 | return 0; |
40 | 44 | } |
41 | 45 |