Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd1edb3a authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ab711fe0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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):
	 */