[PATCH] clocksource: timer-atlas7: Unmap region obtained by of_iomap.

Arvind Yadav arvind.yadav.cs at gmail.com
Wed Jun 28 01:50:35 PDT 2017


In case of error at init time, rollback iomapping.

Signed-off-by: Arvind Yadav <arvind.yadav.cs at gmail.com>
---
 drivers/clocksource/timer-atlas7.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c
index 50300ee..1811038 100644
--- a/drivers/clocksource/timer-atlas7.c
+++ b/drivers/clocksource/timer-atlas7.c
@@ -272,12 +272,14 @@ static int __init sirfsoc_of_timer_init(struct device_node *np)
 	sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0);
 	if (!sirfsoc_timer_irq.irq) {
 		pr_err("No irq passed for timer0 via DT\n");
+		iounmap(sirfsoc_timer_base);
 		return -EINVAL;
 	}
 
 	sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1);
 	if (!sirfsoc_timer1_irq.irq) {
 		pr_err("No irq passed for timer1 via DT\n");
+		iounmap(sirfsoc_timer_base);
 		return -EINVAL;
 	}
 
-- 
1.9.1




More information about the linux-arm-kernel mailing list