diff options
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 4ec55ef5810c..244ca3acb0ee 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -6446,11 +6446,6 @@ int perf_event_init_context(struct task_struct *child, int ctxn) | |||
6446 | unsigned long flags; | 6446 | unsigned long flags; |
6447 | int ret = 0; | 6447 | int ret = 0; |
6448 | 6448 | ||
6449 | child->perf_event_ctxp[ctxn] = NULL; | ||
6450 | |||
6451 | mutex_init(&child->perf_event_mutex); | ||
6452 | INIT_LIST_HEAD(&child->perf_event_list); | ||
6453 | |||
6454 | if (likely(!parent->perf_event_ctxp[ctxn])) | 6449 | if (likely(!parent->perf_event_ctxp[ctxn])) |
6455 | return 0; | 6450 | return 0; |
6456 | 6451 | ||
@@ -6539,6 +6534,10 @@ int perf_event_init_task(struct task_struct *child) | |||
6539 | { | 6534 | { |
6540 | int ctxn, ret; | 6535 | int ctxn, ret; |
6541 | 6536 | ||
6537 | memset(child->perf_event_ctxp, 0, sizeof(child->perf_event_ctxp)); | ||
6538 | mutex_init(&child->perf_event_mutex); | ||
6539 | INIT_LIST_HEAD(&child->perf_event_list); | ||
6540 | |||
6542 | for_each_task_context_nr(ctxn) { | 6541 | for_each_task_context_nr(ctxn) { |
6543 | ret = perf_event_init_context(child, ctxn); | 6542 | ret = perf_event_init_context(child, ctxn); |
6544 | if (ret) | 6543 | if (ret) |