]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/cpu.c
ACPI / processor: prevent cpu from becoming online
[karo-tx-linux.git] / kernel / cpu.c
index 42bd331ee0abff1d542583e14beb20d91f6fae62..f45657f1eb8ee3bb2ae084f5ebc4f22d80675eba 100644 (file)
@@ -348,11 +348,13 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
        unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
        struct task_struct *idle;
 
-       if (cpu_online(cpu) || !cpu_present(cpu))
-               return -EINVAL;
-
        cpu_hotplug_begin();
 
+       if (cpu_online(cpu) || !cpu_present(cpu)) {
+               ret = -EINVAL;
+               goto out;
+       }
+
        idle = idle_thread_get(cpu);
        if (IS_ERR(idle)) {
                ret = PTR_ERR(idle);