[002/146] kmemleak: Initialise kmemleak after debug_objects_mem_init()

From: Greg KH
Date: Wed Jun 01 2011 - 04:06:44 EST

2.6.38-stable review patch. If anyone has any objections, please let us know.


From: Catalin Marinas <catalin.marinas@xxxxxxx>

commit 9b090f2da85bd0df5e1a1ecfe4120b7b50358f48 upstream.

Kmemleak frees objects via RCU and when CONFIG_DEBUG_OBJECTS_RCU_HEAD
is enabled, the RCU callback triggers a call to free_object() in
lib/debugobjects.c. Since kmemleak is initialised before debug objects
initialisation, it may result in a kernel panic during booting. This
patch moves the kmemleak_init() call after debug_objects_mem_init().

Reported-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>
Tested-by: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

init/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/init/main.c
+++ b/init/main.c
@@ -668,8 +668,8 @@ asmlinkage void __init start_kernel(void
- kmemleak_init();
+ kmemleak_init();
if (late_time_init)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/