lkml.org 
[lkml]   [2012]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/1] kmemleak: only scan non-zero-size section
Date
We should only scan that invalid section which size is not
zero as well.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
change for v2
* go a common point, kmemleak_scan_area(), to check size

mm/kmemleak.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 2c0d032..98d62e3 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -923,7 +923,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);
--
1.6.0.4


\
 
 \ /
  Last update: 2012-01-11 09:17    [W:0.036 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site