]> err.no Git - linux-2.6/blobdiff - kernel/fork.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.24
[linux-2.6] / kernel / fork.c
index 28a74015198899c3511f3daedbb2412c750c4fe4..8ca1a14cdc8c12ee8e592f7913f07f22dcec3d9b 100644 (file)
@@ -1123,6 +1123,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->blocked_on = NULL; /* not blocked yet */
 #endif
 
+       /* Perform scheduler related setup. Assign this task to a CPU. */
+       sched_fork(p, clone_flags);
+
        if ((retval = security_task_alloc(p)))
                goto bad_fork_cleanup_policy;
        if ((retval = audit_alloc(p)))
@@ -1212,9 +1215,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        INIT_LIST_HEAD(&p->ptrace_children);
        INIT_LIST_HEAD(&p->ptrace_list);
 
-       /* Perform scheduler related setup. Assign this task to a CPU. */
-       sched_fork(p, clone_flags);
-
        /* Now that the task is set up, run cgroup callbacks if
         * necessary. We need to run them before the task is visible
         * on the tasklist. */