linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource: tegra20_timer: Unmap region obtained by of_iomap
@ 2016-09-21 15:53 Arvind Yadav
  0 siblings, 0 replies; only message in thread
From: Arvind Yadav @ 2016-09-21 15:53 UTC (permalink / raw)
  To: daniel.lezcano, tglx, swarren, thierry.reding, gnurou
  Cc: linux-kernel, linux-tegra

Free memory mapping, if tegra20_init_timer is not successful.

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

diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index f960891..adcd7f4 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -180,6 +180,7 @@ static int __init tegra20_init_timer(struct device_node *np)
 	tegra_timer_irq.irq = irq_of_parse_and_map(np, 2);
 	if (tegra_timer_irq.irq <= 0) {
 		pr_err("Failed to map timer IRQ\n");
+		iounmap(timer_reg_base);
 		return -EINVAL;
 	}
 
@@ -216,6 +217,7 @@ static int __init tegra20_init_timer(struct device_node *np)
 				    clocksource_mmio_readl_up);
 	if (ret) {
 		pr_err("Failed to register clocksource\n");
+		iounmap(timer_reg_base);
 		return ret;
 	}
 
@@ -227,6 +229,7 @@ static int __init tegra20_init_timer(struct device_node *np)
 	ret = setup_irq(tegra_timer_irq.irq, &tegra_timer_irq);
 	if (ret) {
 		pr_err("Failed to register timer IRQ: %d\n", ret);
+		iounmap(timer_reg_base);
 		return ret;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-21 15:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 15:53 [PATCH] clocksource: tegra20_timer: Unmap region obtained by of_iomap Arvind Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).