diff mbox

[ltt-dev] arm-trace-clock-fix-release-pmu

Message ID 1301420332-17224-1-git-send-email-avik.sil@linaro.org
State Accepted
Headers show

Commit Message

Avik Sil March 29, 2011, 5:38 p.m. UTC
ARM trace clock fix release_pmu

Check if reserved_pmu is valid before passing it to release_pmu()

Signed-off-by: Avik Sil <avik.sil@linaro.org>
---
 arch/arm/mach-omap2/trace-clock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/trace-clock.c b/arch/arm/mach-omap2/trace-clock.c
index 3db1cdb..c21bd47 100644
--- a/arch/arm/mach-omap2/trace-clock.c
+++ b/arch/arm/mach-omap2/trace-clock.c
@@ -565,7 +565,8 @@  void put_trace_clock(void)
 	if (trace_clock_refcount != 1)
 		goto end;
 	_stop_trace_clock();
-	release_pmu(reserved_pmu);
+	if (!IS_ERR_OR_NULL(reserved_pmu))
+		release_pmu(reserved_pmu);
 end:
 	trace_clock_refcount--;
 	spin_unlock(&trace_clock_lock);