linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: daniel.lezcano@linaro.org, tglx@linutronix.de,
	swarren@wwwdotorg.org, thierry.reding@gmail.com,
	gnurou@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [PATCH] clocksource: tegra20_timer: Unmap region obtained by of_iomap
Date: Wed, 21 Sep 2016 21:23:35 +0530	[thread overview]
Message-ID: <1474473215-8553-1-git-send-email-arvind.yadav.cs@gmail.com> (raw)

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

                 reply	other threads:[~2016-09-21 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474473215-8553-1-git-send-email-arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=gnurou@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).