summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-02-06 15:36:48 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 07:19:07 +0200
commitfe71230d9a02d267742c893e8acfd870beadc01e (patch)
treeb15f087829bbfa9439970969d373c10a1de8227d /lib
parent30ca85a54edd0a22890e7004e5fe613b34d9d2b2 (diff)
downloadlinux-rt-fe71230d9a02d267742c893e8acfd870beadc01e.tar.gz
kasan: remove redundant initialization of variable 'real_size'
commit 48c232395431c23d35cf3b4c5a090bd793316578 upstream. Variable real_size is initialized with a value that is never read, it is re-assigned a new value later on, hence the initialization is redundant and can be removed. Cleans up clang warning: lib/test_kasan.c:422:21: warning: Value stored to 'real_size' during its initialization is never read Link: http://lkml.kernel.org/r/20180206144950.32457-1-colin.king@canonical.com Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alexander Potapenko <glider@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/test_kasan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index fbdf87920093..4ba4cbe169a8 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -355,7 +355,7 @@ static noinline void __init kasan_stack_oob(void)
static noinline void __init ksize_unpoisons_memory(void)
{
char *ptr;
- size_t size = 123, real_size = size;
+ size_t size = 123, real_size;
pr_info("ksize() unpoisons the whole allocated chunk\n");
ptr = kmalloc(size, GFP_KERNEL);