Commit 436fc4fe authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens

s390: add kmemleak annotation in stack_alloc()

kmemleak with enabled auto scanning reports that our stack allocation is
lost. This is because we're saving the pointer + STACK_INIT_OFFSET to
lowcore. When kmemleak now scans the objects, it thinks that this one is
lost because it can't find a corresponding pointer.
Reported-by: default avatarMarc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Tested-by: default avatarMarc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 2297791c
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/start_kernel.h> #include <linux/start_kernel.h>
#include <linux/hugetlb.h> #include <linux/hugetlb.h>
#include <linux/kmemleak.h>
#include <asm/boot_data.h> #include <asm/boot_data.h>
#include <asm/ipl.h> #include <asm/ipl.h>
...@@ -356,9 +357,12 @@ void *restart_stack; ...@@ -356,9 +357,12 @@ void *restart_stack;
unsigned long stack_alloc(void) unsigned long stack_alloc(void)
{ {
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
return (unsigned long)__vmalloc_node(THREAD_SIZE, THREAD_SIZE, void *ret;
THREADINFO_GFP, NUMA_NO_NODE,
__builtin_return_address(0)); ret = __vmalloc_node(THREAD_SIZE, THREAD_SIZE, THREADINFO_GFP,
NUMA_NO_NODE, __builtin_return_address(0));
kmemleak_not_leak(ret);
return (unsigned long)ret;
#else #else
return __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER); return __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment