]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
kasan: remove redundant initialization of variable 'real_size'
authorColin Ian King <colin.king@canonical.com>
Tue, 6 Feb 2018 23:36:48 +0000 (15:36 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838459
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/test_kasan.c

index ef1a3ac1397e88e436f0fd282804988f3d9b77a1..ebd2cabcc483e0f54c4c041c76ff0063217e0a91 100644 (file)
@@ -388,7 +388,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);