|
@@ -6446,11 +6446,6 @@ int perf_event_init_context(struct task_struct *child, int ctxn)
|
|
|
unsigned long flags;
|
|
|
int ret = 0;
|
|
|
|
|
|
- child->perf_event_ctxp[ctxn] = NULL;
|
|
|
-
|
|
|
- mutex_init(&child->perf_event_mutex);
|
|
|
- INIT_LIST_HEAD(&child->perf_event_list);
|
|
|
-
|
|
|
if (likely(!parent->perf_event_ctxp[ctxn]))
|
|
|
return 0;
|
|
|
|
|
@@ -6539,6 +6534,10 @@ int perf_event_init_task(struct task_struct *child)
|
|
|
{
|
|
|
int ctxn, ret;
|
|
|
|
|
|
+ memset(child->perf_event_ctxp, 0, sizeof(child->perf_event_ctxp));
|
|
|
+ mutex_init(&child->perf_event_mutex);
|
|
|
+ INIT_LIST_HEAD(&child->perf_event_list);
|
|
|
+
|
|
|
for_each_task_context_nr(ctxn) {
|
|
|
ret = perf_event_init_context(child, ctxn);
|
|
|
if (ret)
|