summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-07-18 23:58:24 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-18 23:58:24 +0200
commit823d93640927d739f7c918b73fe5ec494fb27e17 (patch)
treedea028ddd214541b76c1c26f5f21ddc46157e67e /kernel/fork.c
parent7664e969359917ba3212c5d6efdec494eaf8586e (diff)
parentd9914cf66181b8aa0929775f5c6f675c6ebc3eb5 (diff)
Merge branch 'fixes' into pm-sleep
The 'fixes' branch contains material the next commit depends on.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c11
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)
}
err = arch_dup_task_struct(tsk, orig);
- if (err)
- goto out;
+ /*
+ * 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;
+
clear_user_return_notifier(tsk);
clear_tsk_need_resched(tsk);
stackend = end_of_stack(tsk);