diff options
-rw-r--r-- | kernel/cpu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 27dd3ee47099..663c920b2234 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -150,18 +150,18 @@ static int _cpu_down(unsigned int cpu) | |||
150 | p = __stop_machine_run(take_cpu_down, NULL, cpu); | 150 | p = __stop_machine_run(take_cpu_down, NULL, cpu); |
151 | mutex_unlock(&cpu_bitmask_lock); | 151 | mutex_unlock(&cpu_bitmask_lock); |
152 | 152 | ||
153 | if (IS_ERR(p)) { | 153 | if (IS_ERR(p) || cpu_online(cpu)) { |
154 | /* CPU didn't die: tell everyone. Can't complain. */ | 154 | /* CPU didn't die: tell everyone. Can't complain. */ |
155 | if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, | 155 | if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, |
156 | (void *)(long)cpu) == NOTIFY_BAD) | 156 | (void *)(long)cpu) == NOTIFY_BAD) |
157 | BUG(); | 157 | BUG(); |
158 | 158 | ||
159 | err = PTR_ERR(p); | 159 | if (IS_ERR(p)) { |
160 | goto out_allowed; | 160 | err = PTR_ERR(p); |
161 | } | 161 | goto out_allowed; |
162 | 162 | } | |
163 | if (cpu_online(cpu)) | ||
164 | goto out_thread; | 163 | goto out_thread; |
164 | } | ||
165 | 165 | ||
166 | /* Wait for it to sleep (leaving idle task). */ | 166 | /* Wait for it to sleep (leaving idle task). */ |
167 | while (!idle_cpu(cpu)) | 167 | while (!idle_cpu(cpu)) |