Skip to contentSkip to conversation

clocksource: nomadik-mtu: Unmap region obtained by of_iomap

PATCH In review Arvind Yadav 2 participants 2 messages Sep 22, 2016 – Sep 23, 2016 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: nomadik-mtu: Unmap region obtained by of_iomap

Free memory mapping, if nmdk_timer_of_init is not successful.

---
 drivers/clocksource/nomadik-mtu.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clocksource/nomadik-mtu.c +3 -0
index 3c124d1..d99e415c 100644
@@ -267,18 +267,21 @@ static int __init nmdk_timer_of_init(struct device_node *node)
 	pclk = of_clk_get_by_name(node, "apb_pclk");
 	if (IS_ERR(pclk)) {
 		pr_err("could not get apb_pclk");
+		iounmap(base);
 		return PTR_ERR(pclk);
 	}
 
 	clk = of_clk_get_by_name(node, "timclk");
 	if (IS_ERR(clk)) {
 		pr_err("could not get timclk");
+		iounmap(base);
 		return PTR_ERR(clk);
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
 	if (irq <= 0) {
 		pr_err("Can't parse IRQ");
+		iounmap(base);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.7.4