Skip to content

Commit

Permalink
revert "sched: Fix fork() error path to not crash"
Browse files Browse the repository at this point in the history
To make way for "fork: fix error handling in dup_task()", which fixes the
errors more completely.

Cc: Salman Qazi <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Jul 31, 2012
1 parent b2412b7 commit 87bec58
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
}

err = arch_dup_task_struct(tsk, orig);

/*
* We defer looking at err, because we will need this setup
* for the clean up path to work correctly.
*/
tsk->stack = ti;
setup_thread_stack(tsk, orig);

if (err)
goto out;

tsk->stack = ti;

setup_thread_stack(tsk, orig);
clear_user_return_notifier(tsk);
clear_tsk_need_resched(tsk);
stackend = end_of_stack(tsk);
Expand Down

0 comments on commit 87bec58

Please sign in to comment.