From: Vegard Nossum Date: Fri, 6 Jun 2008 14:33:25 +0000 (+0200) Subject: x86: don't return invalid pointers from node_to_cpumask() X-Git-Tag: v2.6.27-rc1~1106^2~246^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03db1f74a7d823e3de3767f36b1e08829f6fb3a1;p=linux-2.6 x86: don't return invalid pointers from node_to_cpumask() Signed-off-by: Vegard Nossum Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index dd12c1c84a..df49ce87a3 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -350,6 +350,7 @@ cpumask_t *_node_to_cpumask_ptr(int node) dump_stack(); return &cpu_online_map; } + BUG_ON(node >= nr_node_ids); return &node_to_cpumask_map[node]; } EXPORT_SYMBOL(_node_to_cpumask_ptr); @@ -365,6 +366,7 @@ cpumask_t node_to_cpumask(int node) dump_stack(); return cpu_online_map; } + BUG_ON(node >= nr_node_ids); return node_to_cpumask_map[node]; } EXPORT_SYMBOL(node_to_cpumask);