diff mbox series

[4/6,SRU,Zesty] clocksource/drivers/arm_arch_timer: Fix read and iounmap of incorrect variable

Message ID 20170830174128.32541-5-dann.frazier@canonical.com
State New
Headers show
Series [1/6,SRU,Zesty] Revert "UBUNTU: SAUCE: arm64: arch_timer: Enable CNTVCT_EL0 trap if workaround is enabled" | expand

Commit Message

dann frazier Aug. 30, 2017, 5:41 p.m. UTC
From: Frank Rowand <frank.rowand@sony.com>

BugLink: https://bugs.launchpad.net/bugs/1713821

Fix boot warning 'Trying to vfree() nonexistent vm area'
from arch_timer_mem_of_init().

Refactored code attempts to read and iounmap using address frame
instead of address ioremap(frame->cntbase).

Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer probing.")

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Reviewed-by: Fu Wei <fu.wei@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit 3db1200ca21f3c63c9044185dc5762ef996848cb)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
---
 drivers/clocksource/arm_arch_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 3f13ad936c74..1c46d9ac6f21 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1219,9 +1219,9 @@  arch_timer_mem_frame_get_cntfrq(struct arch_timer_mem_frame *frame)
 		return 0;
 	}
 
-	rate = readl_relaxed(frame + CNTFRQ);
+	rate = readl_relaxed(base + CNTFRQ);
 
-	iounmap(frame);
+	iounmap(base);
 
 	return rate;
 }