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

dann frazier dann.frazier at canonical.com
Wed Aug 30 17:41:26 UTC 2017

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

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;

More information about the kernel-team mailing list