mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
perf: Do not double free
In case of: err_file: fput(event_file), we'll end up calling perf_release() which in turn will free the event. Do not then free the event _again_. Tested-by: Alexander Shishkin <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Alexander Shishkin <[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: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
84c4e620d3
commit
130056275a
1 changed files with 6 additions and 1 deletions
|
|
@ -8520,7 +8520,12 @@ err_context:
|
|||
perf_unpin_context(ctx);
|
||||
put_ctx(ctx);
|
||||
err_alloc:
|
||||
free_event(event);
|
||||
/*
|
||||
* If event_file is set, the fput() above will have called ->release()
|
||||
* and that will take care of freeing the event.
|
||||
*/
|
||||
if (!event_file)
|
||||
free_event(event);
|
||||
err_cpus:
|
||||
put_online_cpus();
|
||||
err_task:
|
||||
|
|
|
|||
Loading…
Reference in a new issue