From: Catalin Marinas Date: Thu, 19 May 2011 15:25:30 +0000 (+0100) Subject: kmemleak: Initialise kmemleak after debug_objects_mem_init() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9b090f2da85bd0df5e1a1ecfe4120b7b50358f48;p=deliverable%2Flinux.git kmemleak: Initialise kmemleak after debug_objects_mem_init() 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 Tested-by: Tejun Heo Signed-off-by: Catalin Marinas Cc: --- diff --git a/init/main.c b/init/main.c index 4a9479ef4540..48df882d51d2 100644 --- a/init/main.c +++ b/init/main.c @@ -580,8 +580,8 @@ asmlinkage void __init start_kernel(void) #endif page_cgroup_init(); enable_debug_pagealloc(); - kmemleak_init(); debug_objects_mem_init(); + kmemleak_init(); setup_per_cpu_pageset(); numa_policy_init(); if (late_time_init)