diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 675e01e9072a..c07c3335ceac 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1095,7 +1095,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1095 | 1095 | ||
1096 | /* Perform scheduler related setup. Assign this task to a CPU. */ | 1096 | /* Perform scheduler related setup. Assign this task to a CPU. */ |
1097 | sched_fork(p, clone_flags); | 1097 | sched_fork(p, clone_flags); |
1098 | perf_counter_init_task(p); | 1098 | |
1099 | retval = perf_counter_init_task(p); | ||
1100 | if (retval) | ||
1101 | goto bad_fork_cleanup_policy; | ||
1099 | 1102 | ||
1100 | if ((retval = audit_alloc(p))) | 1103 | if ((retval = audit_alloc(p))) |
1101 | goto bad_fork_cleanup_policy; | 1104 | goto bad_fork_cleanup_policy; |
@@ -1295,6 +1298,7 @@ bad_fork_cleanup_semundo: | |||
1295 | bad_fork_cleanup_audit: | 1298 | bad_fork_cleanup_audit: |
1296 | audit_free(p); | 1299 | audit_free(p); |
1297 | bad_fork_cleanup_policy: | 1300 | bad_fork_cleanup_policy: |
1301 | perf_counter_exit_task(p); | ||
1298 | #ifdef CONFIG_NUMA | 1302 | #ifdef CONFIG_NUMA |
1299 | mpol_put(p->mempolicy); | 1303 | mpol_put(p->mempolicy); |
1300 | bad_fork_cleanup_cgroup: | 1304 | bad_fork_cleanup_cgroup: |