diff options
-rw-r--r-- | kernel/perf_event.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 76be4c7bf08e..a962b1962eee 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -2228,7 +2228,7 @@ find_get_context(struct pmu *pmu, struct task_struct *task, int cpu) | |||
2228 | unsigned long flags; | 2228 | unsigned long flags; |
2229 | int ctxn, err; | 2229 | int ctxn, err; |
2230 | 2230 | ||
2231 | if (!task && cpu != -1) { | 2231 | if (!task) { |
2232 | /* Must be root to operate on a CPU event: */ | 2232 | /* Must be root to operate on a CPU event: */ |
2233 | if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN)) | 2233 | if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN)) |
2234 | return ERR_PTR(-EACCES); | 2234 | return ERR_PTR(-EACCES); |