summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-11-08 06:35:10 +0100
committerPaul Mundt <lethal@linux-sh.org>2010-11-08 07:08:42 +0100
commit899be96db75451ba98cb217109ef4cf2ee6de927 (patch)
treeb84ded26b414c160a6a430f55b38f4cc9c28dfa7 /drivers/rtc
parentipw2x00: remove the right /proc/net entry (diff)
downloadlinux-899be96db75451ba98cb217109ef4cf2ee6de927.tar.xz
linux-899be96db75451ba98cb217109ef4cf2ee6de927.zip
rtc: rtc-sh - fix a memory leak
request_mem_region() will call kzalloc to allocate memory for struct resource. release_resource() unregisters the resource but does not free the allocated memory, thus use release_mem_region() instead to fix the memory leak. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 5efbd5990ff8..06e41ed93230 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -761,7 +761,7 @@ err_unmap:
clk_put(rtc->clk);
iounmap(rtc->regbase);
err_badmap:
- release_resource(rtc->res);
+ release_mem_region(rtc->res->start, rtc->regsize);
err_badres:
kfree(rtc);
@@ -786,7 +786,7 @@ static int __exit sh_rtc_remove(struct platform_device *pdev)
}
iounmap(rtc->regbase);
- release_resource(rtc->res);
+ release_mem_region(rtc->res->start, rtc->regsize);
clk_disable(rtc->clk);
clk_put(rtc->clk);