The patch titled Subject: mm/slub.c: freelist is ensured to be NULL when new_slab() fails has been added to the -mm tree. Its filename is mm-slubc-freelist-is-ensured-to-be-null-when-new_slab-fails.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-slubc-freelist-is-ensured-to-be-null-when-new_slab-fails.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-slubc-freelist-is-ensured-to-be-null-when-new_slab-fails.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Peng Wang <rocking@xxxxxxxxxx> Subject: 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@xxxxxxxxxx Signed-off-by: Peng Wang <rocking@xxxxxxxxxx> Reviewed-by: Pekka Enberg <penberg@xxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/slub.c~mm-slubc-freelist-is-ensured-to-be-null-when-new_slab-fails +++ a/mm/slub.c @@ -2463,8 +2463,7 @@ static inline void *new_slab_objects(str stat(s, ALLOC_SLAB); c->page = page; *pc = c; - } else - freelist = NULL; + } return freelist; } _ Patches currently in -mm which might be from rocking@xxxxxxxxxx are mm-slubc-freelist-is-ensured-to-be-null-when-new_slab-fails.patch