Skip to content

Commit b370d29

Browse files
committed
kmemleak: Disable early logging when kmemleak is off by default
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>
1 parent b469d43 commit b370d29

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/kmemleak.c

+1
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,7 @@ void __init kmemleak_init(void)
17571757

17581758
#ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
17591759
if (!kmemleak_skip_disable) {
1760+
atomic_set(&kmemleak_early_log, 0);
17601761
kmemleak_disable();
17611762
return;
17621763
}

0 commit comments

Comments
 (0)