aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2021-08-27 08:36:06 +0200
committerHeiko Carstens <hca@linux.ibm.com>2021-08-31 14:54:14 +0200
commit436fc4feeabbf103d78d50a8e091b3aac28cc37f (patch)
tree9a4001ce8eff24e8a69f19fdb68f472724d36d23 /arch/s390/kernel/setup.c
parents390/cio: dont unregister subchannel from child-drivers (diff)
downloadlinux-dev-436fc4feeabbf103d78d50a8e091b3aac28cc37f.tar.xz
linux-dev-436fc4feeabbf103d78d50a8e091b3aac28cc37f.zip
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: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index fe14beb338e5..1b8316212512 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -50,6 +50,7 @@
#include <linux/compat.h>
#include <linux/start_kernel.h>
#include <linux/hugetlb.h>
+#include <linux/kmemleak.h>
#include <asm/boot_data.h>
#include <asm/ipl.h>
@@ -356,9 +357,12 @@ void *restart_stack;
unsigned long stack_alloc(void)
{
#ifdef CONFIG_VMAP_STACK
- return (unsigned long)__vmalloc_node(THREAD_SIZE, THREAD_SIZE,
- THREADINFO_GFP, NUMA_NO_NODE,
- __builtin_return_address(0));
+ void *ret;
+
+ 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
return __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER);
#endif