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>
This commit is contained in:
parent
ab711fe082
commit
fd1edb3aa2
|
@ -6531,6 +6531,11 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||||
goto err_alloc;
|
goto err_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (task) {
|
||||||
|
put_task_struct(task);
|
||||||
|
task = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look up the group leader (we will attach this event to it):
|
* Look up the group leader (we will attach this event to it):
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue