Skip to content

Commit edde82b

Browse files
Peng Wangtorvalds
authored andcommitted
mm/slub.c: freelist is ensured to be NULL when new_slab() fails
new_slab_objects() will return immediately if freelist is not NULL. if (freelist) return freelist; One more assignment operation could be avoided. Link: http://lkml.kernel.org/r/20181229062512.30469-1-rocking@whu.edu.cn Signed-off-by: Peng Wang <rocking@whu.edu.cn> Reviewed-by: Pekka Enberg <penberg@kernel.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: David Rientjes <rientjes@google.com> Cc: Christoph Lameter <cl@linux.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>
1 parent 5704a06 commit edde82b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mm/slub.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,8 +2482,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
24822482
stat(s, ALLOC_SLAB);
24832483
c->page = page;
24842484
*pc = c;
2485-
} else
2486-
freelist = NULL;
2485+
}
24872486

24882487
return freelist;
24892488
}

0 commit comments

Comments
 (0)