perf: Fix task_struct reference leak
Commit-ID: fd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a Gitweb: http://git.kernel.org/tip/fd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 28 Mar 2011 13:13:56 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 31 Mar 2011 13:02:56 +0200
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 <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc [email protected] # .37+
Signed-off-by Peter Zijlstra <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/perf_event.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
kernel/perf_event.c +5 -0
@@ -6531,6 +6531,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): */