kmemleak: only scan non-zero-size section
Subsystems (2)
PATCH v2 1/1 kmemleak: only scan non-zero-size section
We should only scan that invalid section which size is not zero as well.
Signed-off-by Tiejun Chen <[email protected]>
---
change for v2
* go a common point, kmemleak_scan_area(), to check size
mm/kmemleak.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/kmemleak.c +1 -1
@@ -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 );
Signature · 1 line
1.6.0.4
Catalin Marinas
maintainerQuoted 4 lines · Tiejun Chen
We should only scan that invalid section which size is not zero as well.
Signed-off-by Tiejun Chen <[email protected]>
Looks good. I'll merge it in my kmemleak branch (and send it to Linus at some point).
Thanks.
Signature · 1 line
Catalin