debugobjects: use kmemleak_not_leak for debug object memory
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 7f15dd8a750e ("kmemleak : Make kmemleak_stack_scan optional using config")' Thus kmemleak would think that there is no reference to this and thus we will see this report as leaking memory. Further, this memory would be freed by the debugobjects framework when there is a memory crunch or when the object size exceeds the max limit of ODEBUG_POOL_SIZE. Fix this by using kmemleak_not_leak() when a debug object is allocated to specify explicitly that this is not a leak. Change-Id: I0ce66b1be4e5984681af9fd61883e7010e7bbd1b Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org> Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
This commit is contained in:
parent
1dd9d8dd98
commit
0fd142b587
1 changed files with 2 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <linux/debugfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/hash.h>
|
||||
#include <linux/kmemleak.h>
|
||||
|
||||
#define ODEBUG_HASH_BITS 14
|
||||
#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)
|
||||
|
@ -100,6 +101,7 @@ static void fill_pool(void)
|
|||
if (!new)
|
||||
return;
|
||||
|
||||
kmemleak_not_leak(new);
|
||||
raw_spin_lock_irqsave(&pool_lock, flags);
|
||||
hlist_add_head(&new->node, &obj_pool);
|
||||
obj_pool_free++;
|
||||
|
|
Loading…
Add table
Reference in a new issue