Commit 5796c70e authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

perf/core: Don't leak event in the syscall error path

[ Upstream commit 201c2f85 ]

In the error path, event_file not being NULL is used to determine
whether the event itself still needs to be free'd, so fix it up to
avoid leaking.
Reported-by: default avatarLeon Yu <>
Signed-off-by: default avatarAlexander Shishkin <>
Signed-off-by: default avatarPeter Zijlstra (Intel) <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Jiri Olsa <>
Cc: Linus Torvalds <>
Cc: Peter Zijlstra <>
Cc: Stephane Eranian <>
Cc: Thomas Gleixner <>
Cc: Vince Weaver <>
Fixes: 13005627 ("perf: Do not double free")
Link: default avatarIngo Molnar <>
Signed-off-by: default avatarSasha Levin <>
parent 93e8e691
......@@ -8532,6 +8532,7 @@ SYSCALL_DEFINE5(perf_event_open,
if (IS_ERR(event_file)) {
err = PTR_ERR(event_file);
event_file = NULL;
goto err_context;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment