Skip to content

Commit fc1481a

Browse files
committed
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>
1 parent 3c9a024 commit fc1481a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mm/percpu-km.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535

3636
static int pcpu_populate_chunk(struct pcpu_chunk *chunk, int off, int size)
3737
{
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+
3943
return 0;
4044
}
4145

0 commit comments

Comments
 (0)