Skip to contentSkip to conversation

rtc/rtc-spear: free the config right after the rtc_device_unregister

PATCH In review Devendra Naga 2 participants 5 messages Jun 3, 2012 – Jun 20, 2012 1 message not in the archive Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc/rtc-spear: free the config right after the rtc_device_unregister

the config was freed and its used again at rtc_device_unregister which leads to a kernel panic. so, do it right after the rtc_device_unregister

---
 drivers/rtc/rtc-spear.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-spear.c +1 -1
index 1f76320..e278547 100644
@@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(struct platform_device *pdev)
 	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;
 }
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 6 lines · devendra.aaru
Quoted 1 line · Viresh Kumar

Thanks, at last :-).

Is there any tree through which it can reach torvalds?

The way I would have found this information about any driver is by looking at its
git-log and check via which path patches have been going till date. Maintainers normally adds there signed-off's to patches that go through them.

Andrew Morton, is the one who applied rtc-spear patches till now. Added in cc.

--
viresh

#5 lore raw

Hi Viresh,

Quoted 6 lines · viresh kumar
Quoted 5 lines · devendra.aaru
Quoted 1 line · Viresh Kumar

Thanks, at last :-).

Quoted 9 lines
Quoted 1 line

Is there any tree through which it can reach torvalds?

The way I would have found this information about any driver is by looking at its
git-log and check via which path patches have been going till date. Maintainers normally adds there signed-off's to patches that go through them.

Andrew Morton, is the one who applied rtc-spear patches till now. Added in cc.

Thanks a lot for the information.

Quoted 2 lines

--
viresh

Devendra.