Skip to contentSkip to conversation

mm/slab.c: clean code by removing redundant if condition

PATCH Applied [email protected] 1 participant 1 message Sep 15, 2020 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab.c: clean code by removing redundant if condition

From: Mateusz Nosek <[email protected]>

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.

---
 mm/slab.c | 2 --
 1 file changed, 2 deletions(-)
mm/slab.c +0 -2
index 3160dff6fd76..8f2fd224c1f0 100644
@@ -2301,8 +2301,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) -
Signature · 1 line
2.20.1