summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Nosek <mateusznosek0@gmail.com>2020-10-13 16:48:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-13 18:38:27 -0700
commitc1ff3f95497e64b67230bddc1242f2d228880859 (patch)
treebfde251393ec870333c7001959d017f57e5794b6
parent97383c741b061ed2835802264c16784e42e20fe0 (diff)
mm/slab.c: clean code by removing redundant if condition
The removed code was unnecessary and changed nothing in the flow, since in case of returning NULL by 'kmem_cache_alloc_node' returning 'freelist' from the function in question is the same as returning NULL. Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> 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> Link: https://lkml.kernel.org/r/20200915230329.13002-1-mateusznosek0@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/slab.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/mm/slab.c b/mm/slab.c
index f658e86ec8ce..04bc6a6c48eb 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2305,8 +2305,6 @@ static void *alloc_slabmgmt(struct kmem_cache *cachep,
/* Slab management obj is off-slab. */
freelist = kmem_cache_alloc_node(cachep->freelist_cache,
local_flags, nodeid);
- if (!freelist)
- return NULL;
} else {
/* We will use last bytes at the slab for freelist */
freelist = addr + (PAGE_SIZE << cachep->gfporder) -