clocksource: fsl_ftm_timer: Unmap region obtained by of_iomap
PATCH 1/1 clocksource: fsl_ftm_timer: Unmap region obtained by of_iomap
Free memory mapping, if ftm_timer_init is not successful.
Signed-off-by Arvind Yadav <[email protected]>
--- drivers/clocksource/fsl_ftm_timer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clocksource/fsl_ftm_timer.c +6 -2
@@ -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; }
Signature · 1 line
2.7.4