From: Andrew Morton Date: Thu, 9 Oct 2014 22:25:58 +0000 (-0700) Subject: mm/slab_common.c: suppress warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3aa24f519e48e0db0ccf198d1b766a61d9463ce6;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm/slab_common.c: suppress warning False positive: mm/slab_common.c: In function 'kmem_cache_create': mm/slab_common.c:204: warning: 's' may be used uninitialized in this function Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slab_common.c b/mm/slab_common.c index d319502b2403..cabb842c4e7c 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -211,8 +211,10 @@ kmem_cache_create(const char *name, size_t size, size_t align, mutex_lock(&slab_mutex); err = kmem_cache_sanity_check(name, size); - if (err) + if (err) { + s = NULL; /* suppress uninit var warning */ goto out_unlock; + } /* * Some allocators will constraint the set of valid flags to a subset