[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191110092249.182210-1-zhengyongjun3@huawei.com>
Date: Sun, 10 Nov 2019 17:22:49 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <keescook@...omium.org>, <arnd@...db.de>,
<gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>, <zhengyongjun3@...wei.com>,
Hulk Robot <hulkci@...wei.com>
Subject: [PATCH] lkdtm: Remove set but not used variable 'byte'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/misc/lkdtm/bugs.c: In function lkdtm_STACK_GUARD_PAGE_LEADING:
drivers/misc/lkdtm/bugs.c:236:25: warning: variable byte set but not used [-Wunused-but-set-variable]
drivers/misc/lkdtm/bugs.c: In function lkdtm_STACK_GUARD_PAGE_TRAILING:
drivers/misc/lkdtm/bugs.c:250:25: warning: variable byte set but not used [-Wunused-but-set-variable]
byte is never used, so remove it.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
drivers/misc/lkdtm/bugs.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index 7284a22b1a09..fcd943725b66 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -249,12 +249,9 @@ void lkdtm_STACK_GUARD_PAGE_LEADING(void)
{
const unsigned char *stack = task_stack_page(current);
const unsigned char *ptr = stack - 1;
- volatile unsigned char byte;
pr_info("attempting bad read from page below current stack\n");
- byte = *ptr;
-
pr_err("FAIL: accessed page before stack!\n");
}
@@ -263,12 +260,9 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void)
{
const unsigned char *stack = task_stack_page(current);
const unsigned char *ptr = stack + THREAD_SIZE;
- volatile unsigned char byte;
pr_info("attempting bad read from page above current stack\n");
- byte = *ptr;
-
pr_err("FAIL: accessed page after stack!\n");
}
--
2.23.0
Powered by blists - more mailing lists