Commit 49908e73 authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Linus Torvalds

rtc: mxc: fix memory leak

Free pdata before exit.  Found by cppcheck.

[yuasa@linux-mips.org: add missing iounmap()]
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Reviewed-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Acked-by: default avatarDaniel Mack <daniel@caiaq.de>
Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Cc Yoichi Yuasa <yuasa@linux-mips.org>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 27fb7f00
...@@ -396,8 +396,11 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) ...@@ -396,8 +396,11 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
pdata->ioaddr = ioremap(res->start, resource_size(res)); pdata->ioaddr = ioremap(res->start, resource_size(res));
clk = clk_get(&pdev->dev, "ckil"); clk = clk_get(&pdev->dev, "ckil");
if (IS_ERR(clk)) if (IS_ERR(clk)) {
return PTR_ERR(clk); iounmap(pdata->ioaddr);
ret = PTR_ERR(clk);
goto exit_free_pdata;
}
rate = clk_get_rate(clk); rate = clk_get_rate(clk);
clk_put(clk); clk_put(clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment