public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] kmemleak: only scan non-zero-size section
@ 2012-01-11  5:51 Tiejun Chen
  2012-01-11  9:20 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Tiejun Chen @ 2012-01-11  5:51 UTC (permalink / raw)
  To: catalin.marinas; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-11  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11  5:51 [PATCH v2 1/1] kmemleak: only scan non-zero-size section Tiejun Chen
2012-01-11  9:20 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox