aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Richter <[email protected]>2010-09-29 16:52:25 +0200
committerRobert Richter <[email protected]>2010-10-11 19:27:10 +0200
commit81771974ae49bf79aab60c42eac7a6d730a9ef2b (patch)
tree82f6448db358d7850f52516ebab38f90a6f06190
parentad0f7cfaa85fc033523a09ab1f3dd6b8ded3dff5 (diff)
oprofile, ARM: Release resources on failure
This patch fixes a resource leak on failure, where the oprofilefs and some counters may not released properly. Signed-off-by: Robert Richter <[email protected]> Acked-by: Will Deacon <[email protected]> Cc: [email protected] Cc: <[email protected]> # .35.x LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--drivers/oprofile/oprofile_perf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
index ebb40cb87474..f3d3df229a43 100644
--- a/drivers/oprofile/oprofile_perf.c
+++ b/drivers/oprofile/oprofile_perf.c
@@ -84,6 +84,7 @@ static int op_create_counter(int cpu, int event)
if (IS_ERR(pevent)) {
ret = PTR_ERR(pevent);
} else if (pevent->state != PERF_EVENT_STATE_ACTIVE) {
+ perf_event_release_kernel(pevent);
pr_warning("oprofile: failed to enable event %d "
"on CPU %d\n", event, cpu);
ret = -EBUSY;