aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-03-28 07:13:56 -0400
committerIngo Molnar <mingo@elte.hu>2011-03-31 07:02:56 -0400
commitfd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a (patch)
treeae456f2e42966042790809d7590c31736aa05557 /kernel
parentab711fe08297de1485fff0a366e6db8828cafd6a (diff)
perf: Fix task_struct reference leak
sys_perf_event_open() had an imbalance in the number of task refs it took causing memory leakage Cc: Jiri Olsa <jolsa@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: stable@kernel.org # .37+ Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-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 261690923ffb..27960f114efd 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -6531,6 +6531,11 @@ SYSCALL_DEFINE5(perf_event_open,
6531 goto err_alloc; 6531 goto err_alloc;
6532 } 6532 }
6533 6533
6534 if (task) {
6535 put_task_struct(task);
6536 task = NULL;
6537 }
6538
6534 /* 6539 /*
6535 * Look up the group leader (we will attach this event to it): 6540 * Look up the group leader (we will attach this event to it):
6536 */ 6541 */