Skip to content

Commit 993f0b0

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched/topology: Fix off by one bug
With the addition of the NUMA identity level, we increased @Level by one and will run off the end of the array in the distance sort loop. Fixed: 051f3ca ("sched/topology: Introduce NUMA identity node sched domain") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent a68d750 commit 993f0b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ void sched_init_numa(void)
13371337
int level = 0;
13381338
int i, j, k;
13391339

1340-
sched_domains_numa_distance = kzalloc(sizeof(int) * nr_node_ids, GFP_KERNEL);
1340+
sched_domains_numa_distance = kzalloc(sizeof(int) * (nr_node_ids + 1), GFP_KERNEL);
13411341
if (!sched_domains_numa_distance)
13421342
return;
13431343

0 commit comments

Comments
 (0)