diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2011-03-28 07:13:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-31 07:02:56 -0400 |
commit | fd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a (patch) | |
tree | ae456f2e42966042790809d7590c31736aa05557 /kernel | |
parent | ab711fe08297de1485fff0a366e6db8828cafd6a (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.c | 5 |
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 | */ |