summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-07-19 13:04:14 -0700
committerKees Cook <keescook@chromium.org>2016-08-01 14:27:23 -0700
commit300108740b659c2380a731f147dd85ca0365db4f (patch)
tree161a3dac79c115ce564e6650436db31821620726 /drivers/misc
parent0e06f5c0deeef0332a5da2ecb8f1fcf3e024d958 (diff)
downloadlinux-rpi-300108740b659c2380a731f147dd85ca0365db4f.tar.gz
linux-rpi-300108740b659c2380a731f147dd85ca0365db4f.tar.bz2
linux-rpi-300108740b659c2380a731f147dd85ca0365db4f.zip
lkdtm: fix false positive warning from -Wmaybe-uninitialized
The variable in use here doesn't matter (it's just used to exercise taking up stack space), but this changes its use to pass its address instead, to avoid a compiler warning: drivers/misc/lkdtm_usercopy.c:54:15: warning: 'bad_stack' may be used uninitialized in this function [-Wmaybe-uninitialized] Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/lkdtm_usercopy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/lkdtm_usercopy.c b/drivers/misc/lkdtm_usercopy.c
index 5a3fd76eec27..5525a204db93 100644
--- a/drivers/misc/lkdtm_usercopy.c
+++ b/drivers/misc/lkdtm_usercopy.c
@@ -49,7 +49,7 @@ static noinline void do_usercopy_stack(bool to_user, bool bad_frame)
/* This is a pointer to outside our current stack frame. */
if (bad_frame) {
- bad_stack = do_usercopy_stack_callee((uintptr_t)bad_stack);
+ bad_stack = do_usercopy_stack_callee((uintptr_t)&bad_stack);
} else {
/* Put start address just inside stack. */
bad_stack = task_stack_page(current) + THREAD_SIZE;