diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2010-03-05 16:44:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:46 -0500 |
commit | 49908e739e23e2672d3efb9b1a35f877f8e86342 (patch) | |
tree | 6e86c37ce3736403c80bc4e4138116cc2e326c9a /drivers/rtc | |
parent | 27fb7f009bdb1ff13d4e4c008a2fd36b2305055b (diff) |
rtc: mxc: fix memory leak
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-mxc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 6bd5072d4eb7..8710f9415d98 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -396,8 +396,11 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
396 | pdata->ioaddr = ioremap(res->start, resource_size(res)); | 396 | pdata->ioaddr = ioremap(res->start, resource_size(res)); |
397 | 397 | ||
398 | clk = clk_get(&pdev->dev, "ckil"); | 398 | clk = clk_get(&pdev->dev, "ckil"); |
399 | if (IS_ERR(clk)) | 399 | if (IS_ERR(clk)) { |
400 | return PTR_ERR(clk); | 400 | iounmap(pdata->ioaddr); |
401 | ret = PTR_ERR(clk); | ||
402 | goto exit_free_pdata; | ||
403 | } | ||
401 | 404 | ||
402 | rate = clk_get_rate(clk); | 405 | rate = clk_get_rate(clk); |
403 | clk_put(clk); | 406 | clk_put(clk); |