Commit b370d29ea7565a638ccf85389488364b5abb39fa

Authored by Catalin Marinas
1 parent b469d4329c

kmemleak: Disable early logging when kmemleak is off by default

Commit b6693005 (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>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -1757,6 +1757,7 @@
1757 1757  
1758 1758 #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
1759 1759 if (!kmemleak_skip_disable) {
  1760 + atomic_set(&kmemleak_early_log, 0);
1760 1761 kmemleak_disable();
1761 1762 return;
1762 1763 }