mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-18 23:59:53 +00:00
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>
This commit is contained in:
parent
151f52f09c
commit
899be96db7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user