diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-05-27 16:16:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-30 12:06:00 -0400 |
commit | e9a5f426b85e429bffaee4e0b086b1e742a39fa6 (patch) | |
tree | 65ba763309c5d771c1f179af5b36fce996742b1c | |
parent | 97ef6f7449da6ceddf9a90fa8851f607b67283dd (diff) |
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 <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/cpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; | |||
394 | 394 | ||
395 | int disable_nonboot_cpus(void) | 395 | int disable_nonboot_cpus(void) |
396 | { | 396 | { |
397 | int cpu, first_cpu, error; | 397 | int cpu, first_cpu, error = 0; |
398 | 398 | ||
399 | cpu_maps_update_begin(); | 399 | cpu_maps_update_begin(); |
400 | first_cpu = cpumask_first(cpu_online_mask); | 400 | first_cpu = cpumask_first(cpu_online_mask); |