* [PATCH] clocksource: fsl_ftm_timer: Unmap region obtained by of_iomap
@ 2016-09-22 13:31 Arvind Yadav
0 siblings, 0 replies; 2+ messages in thread
From: Arvind Yadav @ 2016-09-22 13:31 UTC (permalink / raw)
To: daniel.lezcano, tglx, eric; +Cc: linux-kernel
Free memory mapping, if ftm_timer_init is not successful.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/clocksource/fsl_ftm_timer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 738515b..238c821 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -329,13 +329,13 @@ static int __init ftm_timer_init(struct device_node *np)
priv->clkevt_base = of_iomap(np, 0);
if (!priv->clkevt_base) {
pr_err("ftm: unable to map event timer registers\n");
- goto err;
+ goto err_free;
}
priv->clksrc_base = of_iomap(np, 1);
if (!priv->clksrc_base) {
pr_err("ftm: unable to map source timer registers\n");
- goto err;
+ goto err_clkevt_iounmap;
}
ret = -EINVAL;
@@ -366,6 +366,10 @@ static int __init ftm_timer_init(struct device_node *np)
return 0;
err:
+ iounmap(priv->clksrc_base);
+err_clkevt_iounmap:
+ iounmap(priv->clkevt_base);
+err_free:
kfree(priv);
return ret;
}
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] clocksource: fsl_ftm_timer: Unmap region obtained by of_iomap
@ 2017-06-20 11:03 Arvind Yadav
0 siblings, 0 replies; 2+ messages in thread
From: Arvind Yadav @ 2017-06-20 11:03 UTC (permalink / raw)
To: daniel.lezcano, tglx; +Cc: linux-kernel
Free memory mapping, if probe is not successful.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/clocksource/fsl_ftm_timer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 738515b..798523a 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -329,13 +329,13 @@ static int __init ftm_timer_init(struct device_node *np)
priv->clkevt_base = of_iomap(np, 0);
if (!priv->clkevt_base) {
pr_err("ftm: unable to map event timer registers\n");
- goto err;
+ goto err_clkevt;
}
priv->clksrc_base = of_iomap(np, 1);
if (!priv->clksrc_base) {
pr_err("ftm: unable to map source timer registers\n");
- goto err;
+ goto err_clksrc;
}
ret = -EINVAL;
@@ -366,6 +366,10 @@ static int __init ftm_timer_init(struct device_node *np)
return 0;
err:
+ iounmap(priv->clksrc_base);
+err_clksrc:
+ iounmap(priv->clkevt_base);
+err_clkevt:
kfree(priv);
return ret;
}
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-20 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22 13:31 [PATCH] clocksource: fsl_ftm_timer: Unmap region obtained by of_iomap Arvind Yadav
2017-06-20 11:03 Arvind Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®