Skip to content

Commit

Permalink
rtc-core: fix memory leak
Browse files Browse the repository at this point in the history
The idr should be destroyed when the module is unloaded. Found with
kmemleak.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Aaro Koskinen authored and Linus Torvalds committed Mar 6, 2010
1 parent 2e84067 commit 2a7a06a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rtc/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a7a06a

Please sign in to comment.