]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
perf: Fix resource leak in failure path of perf_event_open()
authorTejun Heo <tj@kernel.org>
Sat, 1 May 2010 08:11:35 +0000 (10:11 +0200)
committerIngo Molnar <mingo@elte.hu>
Sat, 1 May 2010 11:11:25 +0000 (13:11 +0200)
commit048c852051d2bd5da54a4488bc1f16b0fc74c695
treec1482ae433455c1aa5f2f20c68773f79b60881c8
parent66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8
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>
kernel/perf_event.c