Commit 03db1f74 authored by Vegard Nossum's avatar Vegard Nossum Committed by Ingo Molnar

x86: don't return invalid pointers from node_to_cpumask()

Signed-off-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 076ac2af
...@@ -350,6 +350,7 @@ cpumask_t *_node_to_cpumask_ptr(int node) ...@@ -350,6 +350,7 @@ cpumask_t *_node_to_cpumask_ptr(int node)
dump_stack(); dump_stack();
return &cpu_online_map; return &cpu_online_map;
} }
BUG_ON(node >= nr_node_ids);
return &node_to_cpumask_map[node]; return &node_to_cpumask_map[node];
} }
EXPORT_SYMBOL(_node_to_cpumask_ptr); EXPORT_SYMBOL(_node_to_cpumask_ptr);
...@@ -365,6 +366,7 @@ cpumask_t node_to_cpumask(int node) ...@@ -365,6 +366,7 @@ cpumask_t node_to_cpumask(int node)
dump_stack(); dump_stack();
return cpu_online_map; return cpu_online_map;
} }
BUG_ON(node >= nr_node_ids);
return node_to_cpumask_map[node]; return node_to_cpumask_map[node];
} }
EXPORT_SYMBOL(node_to_cpumask); EXPORT_SYMBOL(node_to_cpumask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment