Prev: [141/200] pcmcia: avoid validate_cis failure on CIS override
Next: [176/200] NFS: Fix another nfs_wb_page() deadlock
From: Greg KH on 1 Jul 2010 17:40 2.6.34-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephane Eranian <eranian(a)google.com> commit 4b24a88b35e15e04bd8f2c5dda65b5dc8ebca05f upstream. If reserve_pmc_hardware() succeeds but reserve_ds_buffers() fails, then we need to release_pmc_hardware. It won't be done by the destroy() callback because we return before setting it in case of error. Signed-off-by: Stephane Eranian <eranian(a)google.com> Cc: peterz(a)infradead.org Cc: paulus(a)samba.org Cc: davem(a)davemloft.net Cc: fweisbec(a)gmail.com Cc: robert.richter(a)amd.com Cc: perfmon2-devel(a)lists.sf.net LKML-Reference: <4ba1568b.15185e0a.182a.7802(a)mx.google.com> Signed-off-by: Ingo Molnar <mingo(a)elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- arch/x86/kernel/cpu/perf_event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -460,8 +460,11 @@ static int __hw_perf_event_init(struct p if (atomic_read(&active_events) == 0) { if (!reserve_pmc_hardware()) err = -EBUSY; - else + else { err = reserve_bts_hardware(); + if (err) + release_pmc_hardware(); + } } if (!err) atomic_inc(&active_events); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |