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-Url: https://git.stricted.de/?a=commitdiff_plain;h=e9a5f426b85e429bffaee4e0b086b1e742a39fa6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 3097382eb44a..8b92539b4754 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);