diff options
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r-- | kernel/kthread.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 84bbadd4d021..c013bf000ce6 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
@@ -76,6 +76,7 @@ static int kthread(void *_create) | |||
76 | 76 | ||
77 | /* OK, tell user we're spawned, wait for stop or wakeup */ | 77 | /* OK, tell user we're spawned, wait for stop or wakeup */ |
78 | __set_current_state(TASK_UNINTERRUPTIBLE); | 78 | __set_current_state(TASK_UNINTERRUPTIBLE); |
79 | create->result = current; | ||
79 | complete(&create->started); | 80 | complete(&create->started); |
80 | schedule(); | 81 | schedule(); |
81 | 82 | ||
@@ -101,9 +102,6 @@ static void create_kthread(struct kthread_create_info *create) | |||
101 | } else { | 102 | } else { |
102 | struct sched_param param = { .sched_priority = 0 }; | 103 | struct sched_param param = { .sched_priority = 0 }; |
103 | wait_for_completion(&create->started); | 104 | wait_for_completion(&create->started); |
104 | read_lock(&tasklist_lock); | ||
105 | create->result = find_task_by_pid_ns(pid, &init_pid_ns); | ||
106 | read_unlock(&tasklist_lock); | ||
107 | /* | 105 | /* |
108 | * root may have changed our (kthreadd's) priority or CPU mask. | 106 | * root may have changed our (kthreadd's) priority or CPU mask. |
109 | * The kernel thread should not inherit these properties. | 107 | * The kernel thread should not inherit these properties. |