]> Git Repo - linux.git/commitdiff
perf/core: Don't leak event in the syscall error path
authorAlexander Shishkin <[email protected]>
Mon, 21 Mar 2016 08:02:42 +0000 (10:02 +0200)
committerIngo Molnar <[email protected]>
Thu, 31 Mar 2016 07:54:07 +0000 (09:54 +0200)
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: 130056275ade ("perf: Do not double free")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/events/core.c

index 8c11388e92a52043b5fc882a1ce1dbd87e76127d..52bedc5a5aaa190be3545d7534ce065ce735e473 100644 (file)
@@ -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;
        }
 
This page took 0.069136 seconds and 4 git commands to generate.