diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index ab5211b9e622..f00e319d8376 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -304,12 +304,17 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
304 | } | 304 | } |
305 | 305 | ||
306 | err = arch_dup_task_struct(tsk, orig); | 306 | err = arch_dup_task_struct(tsk, orig); |
307 | if (err) | ||
308 | goto out; | ||
309 | 307 | ||
308 | /* | ||
309 | * We defer looking at err, because we will need this setup | ||
310 | * for the clean up path to work correctly. | ||
311 | */ | ||
310 | tsk->stack = ti; | 312 | tsk->stack = ti; |
311 | |||
312 | setup_thread_stack(tsk, orig); | 313 | setup_thread_stack(tsk, orig); |
314 | |||
315 | if (err) | ||
316 | goto out; | ||
317 | |||
313 | clear_user_return_notifier(tsk); | 318 | clear_user_return_notifier(tsk); |
314 | clear_tsk_need_resched(tsk); | 319 | clear_tsk_need_resched(tsk); |
315 | stackend = end_of_stack(tsk); | 320 | stackend = end_of_stack(tsk); |