Skip to content

Commit fb59e72

Browse files
committed
percpu: make pcpu_build_alloc_info() clear static buffers
pcpu_build_alloc_info() may be called multiple times when percpu is falling back to different first chunk allocator. Make it clear static buffers so that they don't contain values from previous runs. Signed-off-by: Tejun Heo <[email protected]>
1 parent ffe0d5a commit fb59e72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mm/percpu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,10 @@ struct pcpu_alloc_info * __init pcpu_build_alloc_info(
13471347
struct pcpu_alloc_info *ai;
13481348
unsigned int *cpu_map;
13491349

1350+
/* this function may be called multiple times */
1351+
memset(group_map, 0, sizeof(group_map));
1352+
memset(group_cnt, 0, sizeof(group_map));
1353+
13501354
/*
13511355
* Determine min_unit_size, alloc_size and max_upa such that
13521356
* alloc_size is multiple of atom_size and is the smallest

0 commit comments

Comments
 (0)