]> Git Repo - linux.git/commitdiff
sched/topology: Fix off by one bug
authorPeter Zijlstra <[email protected]>
Fri, 2 Nov 2018 13:22:25 +0000 (14:22 +0100)
committerIngo Molnar <[email protected]>
Sat, 3 Nov 2018 23:40:03 +0000 (00:40 +0100)
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: 051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain")
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched/topology.c

index 9d74371e4aad86a436c549045be08c2a1ed30853..8d7f15ba59163c3a496f0284c2473a0575d57958 100644 (file)
@@ -1337,7 +1337,7 @@ void sched_init_numa(void)
        int level = 0;
        int i, j, k;
 
-       sched_domains_numa_distance = kzalloc(sizeof(int) * nr_node_ids, GFP_KERNEL);
+       sched_domains_numa_distance = kzalloc(sizeof(int) * (nr_node_ids + 1), GFP_KERNEL);
        if (!sched_domains_numa_distance)
                return;
 
This page took 0.050264 seconds and 4 git commands to generate.