aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2018-11-02 09:22:25 -0400
committerIngo Molnar <mingo@kernel.org>2018-11-03 19:40:03 -0400
commit993f0b0510dad98b4e6e39506834dab0d13fd539 (patch)
treea87e1227438aed493097db201463da1a95e4bdb5 /kernel
parenta68d75081aeccfb169575bea6f452a5a12b9f49b (diff)
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: 051f3ca02e46 ("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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 9d74371e4aad..8d7f15ba5916 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1337,7 +1337,7 @@ void sched_init_numa(void)
1337 int level = 0; 1337 int level = 0;
1338 int i, j, k; 1338 int i, j, k;
1339 1339
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);
1341 if (!sched_domains_numa_distance) 1341 if (!sched_domains_numa_distance)
1342 return; 1342 return;
1343 1343