Skip to content

Commit

Permalink
kmemleak: Disable early logging when kmemleak is off by default
Browse files Browse the repository at this point in the history
Commit b669300 (kmemleak: When the early log buffer is exceeded, report
the actual number) deferred the disabling of the early logging to
kmemleak_init(). However, when CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y, the
early logging was no longer disabled causing __init kmemleak functions
to be called even after the kernel freed the init memory. This patch
disables the early logging during kmemleak_init() if kmemleak is left
disabled.

Reported-by: Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Tested-by: Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Tested-by: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
ctmarinas committed Jan 20, 2012
1 parent b469d43 commit b370d29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ void __init kmemleak_init(void)

#ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
if (!kmemleak_skip_disable) {
atomic_set(&kmemleak_early_log, 0);
kmemleak_disable();
return;
}
Expand Down

0 comments on commit b370d29

Please sign in to comment.