Skip to content

Commit fea1543

Browse files
committed
Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull debugobjects fix from Ingo Molnar: "A single commit making debugobjects interact better with kmemleak" * 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Make kmemleak ignore debug objects
2 parents 81a84ad + caba4cb commit fea1543

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

init/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ asmlinkage __visible void __init start_kernel(void)
651651
}
652652
#endif
653653
page_ext_init();
654-
debug_objects_mem_init();
655654
kmemleak_init();
655+
debug_objects_mem_init();
656656
setup_per_cpu_pageset();
657657
numa_policy_init();
658658
if (late_time_init)

lib/debugobjects.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/debugfs.h>
1919
#include <linux/slab.h>
2020
#include <linux/hash.h>
21+
#include <linux/kmemleak.h>
2122

2223
#define ODEBUG_HASH_BITS 14
2324
#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)
@@ -110,6 +111,7 @@ static void fill_pool(void)
110111
if (!new)
111112
return;
112113

114+
kmemleak_ignore(new);
113115
raw_spin_lock_irqsave(&pool_lock, flags);
114116
hlist_add_head(&new->node, &obj_pool);
115117
debug_objects_allocated++;
@@ -1080,6 +1082,7 @@ static int __init debug_objects_replace_static_objects(void)
10801082
obj = kmem_cache_zalloc(obj_cache, GFP_KERNEL);
10811083
if (!obj)
10821084
goto free;
1085+
kmemleak_ignore(obj);
10831086
hlist_add_head(&obj->node, &objects);
10841087
}
10851088

0 commit comments

Comments
 (0)