Patchwork rtc-core: fix memory leak

login
register
mail settings
Submitter Aaro Koskinen
Date Feb. 15, 2010, 4:54 p.m.
Message ID <1266252846-12602-1-git-send-email-aaro.koskinen@nokia.com>
Download mbox | patch
Permalink /patch/45410/
State New
Headers show

Comments

Aaro Koskinen - Feb. 15, 2010, 4:54 p.m.
The idr should be destroyed when the module is unloaded. Found with
kmemleak.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: stable <stable@kernel.org>
---
 drivers/rtc/class.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index be5a6b7..40845c7 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -226,6 +226,7 @@  static void __exit rtc_exit(void)
 {
 	rtc_dev_exit();
 	class_destroy(rtc_class);
+	idr_destroy(&rtc_idr);
 }
 
 subsys_initcall(rtc_init);