Commit 2a7a06a0 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Linus Torvalds

rtc-core: fix memory leak

The idr should be destroyed when the module is unloaded. Found with
kmemleak.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@nokia.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e84067b
...@@ -226,6 +226,7 @@ static void __exit rtc_exit(void) ...@@ -226,6 +226,7 @@ static void __exit rtc_exit(void)
{ {
rtc_dev_exit(); rtc_dev_exit();
class_destroy(rtc_class); class_destroy(rtc_class);
idr_destroy(&rtc_idr);
} }
subsys_initcall(rtc_init); subsys_initcall(rtc_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment