aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-05-01 10:11:35 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-12 15:02:42 -0700
commit0c41fcd0b738e0ac646e043ed47b7f642947b6a0 (patch)
tree59be0811a4969ad12d9f3de71fbe85fd0c7537de /kernel
parentb9d41d81abb6dba3ce122138f9593f4693f60dc9 (diff)
perf: Fix resource leak in failure path of perf_event_open()
commit 048c852051d2bd5da54a4488bc1f16b0fc74c695 upstream. 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> LKML-Reference: <4BDBE237.1040809@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 32d0ae23007..e928e1af7b7 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4811,7 +4811,7 @@ err_fput_free_put_context:
err_free_put_context:
if (err < 0)
- kfree(event);
+ free_event(event);
err_put_context:
if (err < 0)