summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/fsl_ftm_timer.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-06-20 16:33:30 +0530
committerDaniel Lezcano <daniel.lezcano@linaro.org>2017-06-27 11:25:39 +0200
commitb70957f656cc070eaaac60b00dca5b40967cb8d6 (patch)
tree3b04e1a85ddce8e11523f75994b11c1d933539aa /drivers/clocksource/fsl_ftm_timer.c
parent6ec8be251fb445dcc43086a485fec1b2708c09da (diff)
downloadlinux-b70957f656cc070eaaac60b00dca5b40967cb8d6.tar.bz2
clocksource/drivers/fsl_ftm_timer: Unmap region obtained by of_iomap
In case of error at init time, rollback iomapping. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/fsl_ftm_timer.c')
-rw-r--r--drivers/clocksource/fsl_ftm_timer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 3121e2d96c91..3ee7e6fea621 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;
}