Преглед изворни кода

Make sure that the processor is actually online or die spectacularly.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Ralf Baechle пре 20 година
родитељ
комит
ae1b3d51c8
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      arch/mips/kernel/smp.c

+ 5 - 0
arch/mips/kernel/smp.c

@@ -142,6 +142,11 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
 	int i, cpus = num_online_cpus() - 1;
 	int i, cpus = num_online_cpus() - 1;
 	int cpu = smp_processor_id();
 	int cpu = smp_processor_id();
 
 
+	/*
+	 * Can die spectacularly if this CPU isn't yet marked online
+	 */
+	BUG_ON(!cpu_online(cpu));
+
 	if (!cpus)
 	if (!cpus)
 		return 0;
 		return 0;