From: Devendra Naga <[email protected]> Subject: 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 <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> --- drivers/rtc/rtc-spear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/rtc/rtc-spear.c~drivers-rtc-rtc-spearc-fix-use-after-free-in-spear_rtc_remove drivers/rtc/rtc-spear.c --- a/drivers/rtc/rtc-spear.c~drivers-rtc-rtc-spearc-fix-use-after-free-in-spear_rtc_remove +++ a/drivers/rtc/rtc-spear.c @@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(st clk_disable(config->clk); clk_put(config->clk); iounmap(config->ioaddr); - kfree(config); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res) release_mem_region(res->start, resource_size(res)); platform_set_drvdata(pdev, NULL); rtc_device_unregister(config->rtc); + kfree(config); return 0; } _ -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
