diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 14eca80918dc..f571f514de2a 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -455,8 +455,11 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
455 | if (atomic_read(&active_events) == 0) { | 455 | if (atomic_read(&active_events) == 0) { |
456 | if (!reserve_pmc_hardware()) | 456 | if (!reserve_pmc_hardware()) |
457 | err = -EBUSY; | 457 | err = -EBUSY; |
458 | else | 458 | else { |
459 | err = reserve_ds_buffers(); | 459 | err = reserve_ds_buffers(); |
460 | if (err) | ||
461 | release_pmc_hardware(); | ||
462 | } | ||
460 | } | 463 | } |
461 | if (!err) | 464 | if (!err) |
462 | atomic_inc(&active_events); | 465 | atomic_inc(&active_events); |