You need to sign in or sign up before continuing.
提交 b70957f6 编写于 作者: A Arvind Yadav 提交者: Daniel Lezcano

clocksource/drivers/fsl_ftm_timer: Unmap region obtained by of_iomap

In case of error at init time, rollback iomapping.
Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 6ec8be25
...@@ -329,13 +329,13 @@ static int __init ftm_timer_init(struct device_node *np) ...@@ -329,13 +329,13 @@ static int __init ftm_timer_init(struct device_node *np)
priv->clkevt_base = of_iomap(np, 0); priv->clkevt_base = of_iomap(np, 0);
if (!priv->clkevt_base) { if (!priv->clkevt_base) {
pr_err("ftm: unable to map event timer registers\n"); pr_err("ftm: unable to map event timer registers\n");
goto err; goto err_clkevt;
} }
priv->clksrc_base = of_iomap(np, 1); priv->clksrc_base = of_iomap(np, 1);
if (!priv->clksrc_base) { if (!priv->clksrc_base) {
pr_err("ftm: unable to map source timer registers\n"); pr_err("ftm: unable to map source timer registers\n");
goto err; goto err_clksrc;
} }
ret = -EINVAL; ret = -EINVAL;
...@@ -366,6 +366,10 @@ static int __init ftm_timer_init(struct device_node *np) ...@@ -366,6 +366,10 @@ static int __init ftm_timer_init(struct device_node *np)
return 0; return 0;
err: err:
iounmap(priv->clksrc_base);
err_clksrc:
iounmap(priv->clkevt_base);
err_clkevt:
kfree(priv); kfree(priv);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册