Skip to content

Commit

Permalink
rtc: mxc: fix memory leak
Browse files Browse the repository at this point in the history
Free pdata before exit.  Found by cppcheck.

[yuasa@linux-mips.org: add missing iounmap()]
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc Yoichi Yuasa <yuasa@linux-mips.org>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alexander Beregalov authored and Linus Torvalds committed Mar 6, 2010
1 parent 27fb7f0 commit 49908e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/rtc/rtc-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,11 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
pdata->ioaddr = ioremap(res->start, resource_size(res));

clk = clk_get(&pdev->dev, "ckil");
if (IS_ERR(clk))
return PTR_ERR(clk);
if (IS_ERR(clk)) {
iounmap(pdata->ioaddr);
ret = PTR_ERR(clk);
goto exit_free_pdata;
}

rate = clk_get_rate(clk);
clk_put(clk);
Expand Down

0 comments on commit 49908e7

Please sign in to comment.