Skip to content

Commit

Permalink
mm/slab_common.c: suppress warning
Browse files Browse the repository at this point in the history
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 <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Oct 10, 2014
1 parent bf3e269 commit 3aa24f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3aa24f5

Please sign in to comment.