|
@@ -532,13 +532,11 @@ int kthread_stop(struct task_struct *k)
|
|
|
trace_sched_kthread_stop(k);
|
|
|
|
|
|
get_task_struct(k);
|
|
|
- kthread = to_live_kthread(k);
|
|
|
- if (kthread) {
|
|
|
- set_bit(KTHREAD_SHOULD_STOP, &kthread->flags);
|
|
|
- __kthread_unpark(k, kthread);
|
|
|
- wake_up_process(k);
|
|
|
- wait_for_completion(&kthread->exited);
|
|
|
- }
|
|
|
+ kthread = to_kthread(k);
|
|
|
+ set_bit(KTHREAD_SHOULD_STOP, &kthread->flags);
|
|
|
+ __kthread_unpark(k, kthread);
|
|
|
+ wake_up_process(k);
|
|
|
+ wait_for_completion(&kthread->exited);
|
|
|
ret = k->exit_code;
|
|
|
put_task_struct(k);
|
|
|
|