aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-07-30 17:42:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:20 -0400
commit87bec58a52652e2eb2a575692a40f9466c7bd31b (patch)
treebd7d6408b61ee2c1ad6df9f0b44277fb08e75034 /kernel/fork.c
parentb2412b7fa7a3816fa8633dc2ff19f1a90aabe423 (diff)
revert "sched: Fix fork() error path to not crash"
To make way for "fork: fix error handling in dup_task()", which fixes the errors more completely. Cc: Salman Qazi <sqazi@google.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@elte.hu> Cc: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 2c1802948a38..088025bd1925 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -304,17 +304,12 @@ 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
308 /*
309 * We defer looking at err, because we will need this setup
310 * for the clean up path to work correctly.
311 */
312 tsk->stack = ti;
313 setup_thread_stack(tsk, orig);
314
315 if (err) 307 if (err)
316 goto out; 308 goto out;
317 309
310 tsk->stack = ti;
311
312 setup_thread_stack(tsk, orig);
318 clear_user_return_notifier(tsk); 313 clear_user_return_notifier(tsk);
319 clear_tsk_need_resched(tsk); 314 clear_tsk_need_resched(tsk);
320 stackend = end_of_stack(tsk); 315 stackend = end_of_stack(tsk);