Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932282Ab2FCGYn (ORCPT ); Sun, 3 Jun 2012 02:24:43 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:37033 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752827Ab2FCGYm (ORCPT ); Sun, 3 Jun 2012 02:24:42 -0400 From: Devendra Naga To: Alessandro Zummo , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Cc: Devendra Naga Subject: [PATCH] rtc/rtc-spear: free the config right after the rtc_device_unregister Date: Sun, 3 Jun 2012 11:54:19 +0530 Message-Id: <1338704660-30921-1-git-send-email-devendra.aaru@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1114 Lines: 34 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 Signed-off-by: Devendra Naga --- drivers/rtc/rtc-spear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index 1f76320..e278547 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c @@ -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; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/