summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTiejun Chen <tiejun.chen@windriver.com>2012-01-11 06:51:10 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2012-01-20 17:54:35 +0100
commitb469d4329cf949043f9b93a6644f2c64015ef8cd (patch)
tree908bb5053e9f5033086050a3d3da9b18ce0ef632 /mm
parentLinux 3.3-rc1 (diff)
downloadlinux-b469d4329cf949043f9b93a6644f2c64015ef8cd.tar.xz
linux-b469d4329cf949043f9b93a6644f2c64015ef8cd.zip
kmemleak: Only scan non-zero-size areas
Kmemleak should only track valid scan areas with a non-zero size. Otherwise, such area may reside just at the end of an object and kmemleak would report "Adding scan area to unknown object". Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/kmemleak.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index c833addd94d7..f9f7310f0fdb 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)
{
pr_debug("%s(0x%p)\n", __func__, ptr);
- if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
+ if (atomic_read(&kmemleak_enabled) && ptr && size && !IS_ERR(ptr))
add_scan_area((unsigned long)ptr, size, gfp);
else if (atomic_read(&kmemleak_early_log))
log_early(KMEMLEAK_SCAN_AREA, ptr, size, 0);