mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
drivers/rtc/rtc-spear.c: fix use-after-free in spear_rtc_remove()
`config' is freed and is then used in the rtc_device_unregister() call, causing a kernel panic. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Reviewed-by: Viresh Kumar <viresh.linux@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d8adde17e5
commit
2a643893e5
1 changed files with 1 additions and 1 deletions
|
@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(struct platform_device *pdev)
|
||||||
clk_disable(config->clk);
|
clk_disable(config->clk);
|
||||||
clk_put(config->clk);
|
clk_put(config->clk);
|
||||||
iounmap(config->ioaddr);
|
iounmap(config->ioaddr);
|
||||||
kfree(config);
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (res)
|
if (res)
|
||||||
release_mem_region(res->start, resource_size(res));
|
release_mem_region(res->start, resource_size(res));
|
||||||
platform_set_drvdata(pdev, NULL);
|
platform_set_drvdata(pdev, NULL);
|
||||||
rtc_device_unregister(config->rtc);
|
rtc_device_unregister(config->rtc);
|
||||||
|
kfree(config);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue