diff options
author | Tejun Heo <tj@kernel.org> | 2010-05-01 10:11:35 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-01 13:11:25 +0200 |
commit | 048c852051d2bd5da54a4488bc1f16b0fc74c695 (patch) | |
tree | c1482ae433455c1aa5f2f20c68773f79b60881c8 /kernel/perf_event.c | |
parent | 66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8 (diff) | |
download | op-kernel-dev-048c852051d2bd5da54a4488bc1f16b0fc74c695.zip op-kernel-dev-048c852051d2bd5da54a4488bc1f16b0fc74c695.tar.gz |
perf: Fix resource leak in failure path of perf_event_open()
perf_event_open() kfrees event after init failure which doesn't
release all resources allocated by perf_event_alloc(). Use
free_event() instead.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: <stable@kernel.org>
LKML-Reference: <4BDBE237.1040809@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 2f3fbf8..3d1552d 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -4897,7 +4897,7 @@ err_fput_free_put_context: err_free_put_context: if (err < 0) - kfree(event); + free_event(event); err_put_context: if (err < 0) |