Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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>
  • Loading branch information...
commit ed6c1115c835d822ec5d6356ae3043de54088f43 1 parent 9b8327b
Tejun Heo authored penberg committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 mm/percpu-km.c
View
6 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.