diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 19:44:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 19:44:13 -0400 |
commit | 83d7e948754cf021ed7343b122940fcc27c1bd88 (patch) | |
tree | f04ba1ecb4fa337fc2bbd49b44df07775e4636ff | |
parent | fce4a1dda2f1a9a25b3e5b7cd951070e0b42a818 (diff) | |
parent | 9b090f2da85bd0df5e1a1ecfe4120b7b50358f48 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm:
kmemleak: Initialise kmemleak after debug_objects_mem_init()
kmemleak: Select DEBUG_FS unconditionally in DEBUG_KMEMLEAK
kmemleak: Do not return a pointer to an object that kmemleak did not get
-rw-r--r-- | init/main.c | 2 | ||||
-rw-r--r-- | lib/Kconfig.debug | 2 | ||||
-rw-r--r-- | mm/kmemleak.c | 7 |
3 files changed, 7 insertions, 4 deletions
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) | |||
580 | #endif | 580 | #endif |
581 | page_cgroup_init(); | 581 | page_cgroup_init(); |
582 | enable_debug_pagealloc(); | 582 | enable_debug_pagealloc(); |
583 | kmemleak_init(); | ||
584 | debug_objects_mem_init(); | 583 | debug_objects_mem_init(); |
584 | kmemleak_init(); | ||
585 | setup_per_cpu_pageset(); | 585 | setup_per_cpu_pageset(); |
586 | numa_policy_init(); | 586 | numa_policy_init(); |
587 | if (late_time_init) | 587 | if (late_time_init) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f0aa00ba3fac..17ac5f87182d 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -400,7 +400,7 @@ config DEBUG_KMEMLEAK | |||
400 | depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ | 400 | depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ |
401 | (X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE) | 401 | (X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE) |
402 | 402 | ||
403 | select DEBUG_FS if SYSFS | 403 | select DEBUG_FS |
404 | select STACKTRACE if STACKTRACE_SUPPORT | 404 | select STACKTRACE if STACKTRACE_SUPPORT |
405 | select KALLSYMS | 405 | select KALLSYMS |
406 | select CRC32 | 406 | select CRC32 |
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c1d5867543e4..aacee45616fc 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -1414,9 +1414,12 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1414 | ++(*pos); | 1414 | ++(*pos); |
1415 | 1415 | ||
1416 | list_for_each_continue_rcu(n, &object_list) { | 1416 | list_for_each_continue_rcu(n, &object_list) { |
1417 | next_obj = list_entry(n, struct kmemleak_object, object_list); | 1417 | struct kmemleak_object *obj = |
1418 | if (get_object(next_obj)) | 1418 | list_entry(n, struct kmemleak_object, object_list); |
1419 | if (get_object(obj)) { | ||
1420 | next_obj = obj; | ||
1419 | break; | 1421 | break; |
1422 | } | ||
1420 | } | 1423 | } |
1421 | 1424 | ||
1422 | put_object(prev_obj); | 1425 | put_object(prev_obj); |