summaryrefslogtreecommitdiff
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index f81f9d6395a..07fcc8568fa 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5917,6 +5917,11 @@ SYSCALL_DEFINE5(perf_event_open,
goto err_alloc;
}
+ if (task) {
+ put_task_struct(task);
+ task = NULL;
+ }
+
/*
* Look up the group leader (we will attach this event to it):
*/