diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/kmemleak.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c833addd94d7..45eb6217bf38 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -1036,7 +1036,7 @@ void __ref kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) | |||
1036 | { | 1036 | { |
1037 | pr_debug("%s(0x%p)\n", __func__, ptr); | 1037 | pr_debug("%s(0x%p)\n", __func__, ptr); |
1038 | 1038 | ||
1039 | if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr)) | 1039 | if (atomic_read(&kmemleak_enabled) && ptr && size && !IS_ERR(ptr)) |
1040 | add_scan_area((unsigned long)ptr, size, gfp); | 1040 | add_scan_area((unsigned long)ptr, size, gfp); |
1041 | else if (atomic_read(&kmemleak_early_log)) | 1041 | else if (atomic_read(&kmemleak_early_log)) |
1042 | log_early(KMEMLEAK_SCAN_AREA, ptr, size, 0); | 1042 | log_early(KMEMLEAK_SCAN_AREA, ptr, size, 0); |
@@ -1757,6 +1757,7 @@ void __init kmemleak_init(void) | |||
1757 | 1757 | ||
1758 | #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF | 1758 | #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF |
1759 | if (!kmemleak_skip_disable) { | 1759 | if (!kmemleak_skip_disable) { |
1760 | atomic_set(&kmemleak_early_log, 0); | ||
1760 | kmemleak_disable(); | 1761 | kmemleak_disable(); |
1761 | return; | 1762 | return; |
1762 | } | 1763 | } |