diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 158710d22566..e0d0b77343f8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -171,10 +171,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
171 | return NULL; | 171 | return NULL; |
172 | } | 172 | } |
173 | 173 | ||
174 | *ti = *orig->thread_info; | ||
175 | *tsk = *orig; | 174 | *tsk = *orig; |
176 | tsk->thread_info = ti; | 175 | tsk->thread_info = ti; |
177 | ti->task = tsk; | 176 | setup_thread_stack(tsk, orig); |
178 | 177 | ||
179 | /* One for us, one for whoever does the "release_task()" (usually parent) */ | 178 | /* One for us, one for whoever does the "release_task()" (usually parent) */ |
180 | atomic_set(&tsk->usage,2); | 179 | atomic_set(&tsk->usage,2); |
@@ -324,7 +323,6 @@ static struct mm_struct * mm_init(struct mm_struct * mm) | |||
324 | spin_lock_init(&mm->page_table_lock); | 323 | spin_lock_init(&mm->page_table_lock); |
325 | rwlock_init(&mm->ioctx_list_lock); | 324 | rwlock_init(&mm->ioctx_list_lock); |
326 | mm->ioctx_list = NULL; | 325 | mm->ioctx_list = NULL; |
327 | mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm); | ||
328 | mm->free_area_cache = TASK_UNMAPPED_BASE; | 326 | mm->free_area_cache = TASK_UNMAPPED_BASE; |
329 | mm->cached_hole_size = ~0UL; | 327 | mm->cached_hole_size = ~0UL; |
330 | 328 | ||
@@ -919,7 +917,7 @@ static task_t *copy_process(unsigned long clone_flags, | |||
919 | if (nr_threads >= max_threads) | 917 | if (nr_threads >= max_threads) |
920 | goto bad_fork_cleanup_count; | 918 | goto bad_fork_cleanup_count; |
921 | 919 | ||
922 | if (!try_module_get(p->thread_info->exec_domain->module)) | 920 | if (!try_module_get(task_thread_info(p)->exec_domain->module)) |
923 | goto bad_fork_cleanup_count; | 921 | goto bad_fork_cleanup_count; |
924 | 922 | ||
925 | if (p->binfmt && !try_module_get(p->binfmt->module)) | 923 | if (p->binfmt && !try_module_get(p->binfmt->module)) |
@@ -1180,7 +1178,7 @@ bad_fork_cleanup: | |||
1180 | if (p->binfmt) | 1178 | if (p->binfmt) |
1181 | module_put(p->binfmt->module); | 1179 | module_put(p->binfmt->module); |
1182 | bad_fork_cleanup_put_domain: | 1180 | bad_fork_cleanup_put_domain: |
1183 | module_put(p->thread_info->exec_domain->module); | 1181 | module_put(task_thread_info(p)->exec_domain->module); |
1184 | bad_fork_cleanup_count: | 1182 | bad_fork_cleanup_count: |
1185 | put_group_info(p->group_info); | 1183 | put_group_info(p->group_info); |
1186 | atomic_dec(&p->user->processes); | 1184 | atomic_dec(&p->user->processes); |