|
@@ -6252,6 +6252,8 @@ SYSCALL_DEFINE5(perf_event_open,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ get_online_cpus();
|
|
|
+
|
|
|
event = perf_event_alloc(&attr, cpu, task, group_leader, NULL,
|
|
|
NULL, NULL);
|
|
|
if (IS_ERR(event)) {
|
|
@@ -6391,6 +6393,8 @@ SYSCALL_DEFINE5(perf_event_open,
|
|
|
perf_unpin_context(ctx);
|
|
|
mutex_unlock(&ctx->mutex);
|
|
|
|
|
|
+ put_online_cpus();
|
|
|
+
|
|
|
event->owner = current;
|
|
|
|
|
|
mutex_lock(¤t->perf_event_mutex);
|
|
@@ -6419,6 +6423,7 @@ err_context:
|
|
|
err_alloc:
|
|
|
free_event(event);
|
|
|
err_task:
|
|
|
+ put_online_cpus();
|
|
|
if (task)
|
|
|
put_task_struct(task);
|
|
|
err_group_fd:
|