mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
perf/core: Don't leak event in the syscall error path
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: Leon Yu <[email protected]>
Signed-off-by: Alexander Shishkin <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Fixes: 130056275a ("perf: Do not double free")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
committed by
Ingo Molnar
parent
8fdc65391c
commit
201c2f85bd
@@ -8542,6 +8542,7 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||
f_flags);
|
||||
if (IS_ERR(event_file)) {
|
||||
err = PTR_ERR(event_file);
|
||||
event_file = NULL;
|
||||
goto err_context;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user