From: Mateusz Nosek Date: Tue, 13 Oct 2020 23:48:34 +0000 (-0700) Subject: mm/slab.c: clean code by removing redundant if condition X-Git-Tag: v5.15~2704^2~162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1ff3f95497e64b67230bddc1242f2d228880859;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Link: https://lkml.kernel.org/r/20200915230329.13002-1-mateusznosek0@gmail.com Signed-off-by: Linus Torvalds --- diff --git a/mm/slab.c b/mm/slab.c index f658e86..04bc6a6 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) -