From cb38c289f14b8ad8fad4c15fee6edf6599da2c0e Mon Sep 17 00:00:00 2001 From: Kishan Kumar Date: Fri, 29 May 2015 19:11:25 +0530 Subject: [PATCH] debugobjects: use kmemleak_not_leak for obj_cache debug objects are placed in a list obj_pool which is static. This is placed in __initdata which kmemleak will not scan unless task stack scan is enabled. We have taken the explicit choice of disabling task stack scan by default through the creation of config in the commit 7f15dd8a750e7cf9ec7346dcb881b5acbef0d5c9. Thus kmemleak would think that there is no reference to this and thus we will see this report as leaking memory. Fix this by using kmemleak_not_leak() when obj_cache is created to specify explicitly that this is not a leak. Change-Id: I3c06911b60ce15f3aae336ef7b96c960da2270d9 Signed-off-by: Kishan Kumar --- lib/debugobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index dfa43e7ca64c..90e253a4a568 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -1079,7 +1079,7 @@ void __init debug_objects_mem_init(void) obj_cache = kmem_cache_create("debug_objects_cache", sizeof (struct debug_obj), 0, SLAB_DEBUG_OBJECTS, NULL); - + kmemleak_not_leak(obj_cache); if (!obj_cache || debug_objects_replace_static_objects()) { debug_objects_enabled = 0; if (obj_cache)