From: Aaro Koskinen Date: Fri, 5 Mar 2010 21:44:24 +0000 (-0800) Subject: rtc-core: fix memory leak X-Git-Tag: upstream/snapshot3+hdmi~15346 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a7a06a0cdd86d572e91657603180da5992be6d3;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git rtc-core: fix memory leak The idr should be destroyed when the module is unloaded. Found with kmemleak. Signed-off-by: Aaro Koskinen Cc: Alessandro Zummo Cc: stable Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);