From: Rafael J. Wysocki Date: Thu, 27 May 2010 20:16:22 +0000 (+0200) Subject: CPU: Avoid using unititialized error variable in disable_nonboot_cpus() X-Git-Tag: v2.6.35-rc1~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9a5f426b85e429bffaee4e0b086b1e742a39fa6;p=profile%2Fivi%2Fkernel-x86-ivi.git CPU: Avoid using unititialized error variable in disable_nonboot_cpus() If there's only one CPU online when disable_nonboot_cpus() is called, the error variable will not be initialized and that may lead to erroneous behavior. Fix this issue by initializing error in disable_nonboot_cpus() as appropriate. Signed-off-by: Rafael J. Wysocki Signed-off-by: Linus Torvalds --- diff --git a/kernel/cpu.c b/kernel/cpu.c index 3097382eb44..8b92539b475 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -394,7 +394,7 @@ static cpumask_var_t frozen_cpus; int disable_nonboot_cpus(void) { - int cpu, first_cpu, error; + int cpu, first_cpu, error = 0; cpu_maps_update_begin(); first_cpu = cpumask_first(cpu_online_mask);