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 7f15dd8a75.

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 <kishank@codeaurora.org>
This commit is contained in:
Kishan Kumar 2015-05-29 19:11:25 +05:30 committed by Gerrit - the friendly Code Review server
parent 9565f82b6e
commit 706c423e0f

View File

@ -1077,7 +1077,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)