Skip to content

Commit

Permalink
mm/slub.c: freelist is ensured to be NULL when new_slab() fails
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Peng Wang <[email protected]>
Reviewed-by: Pekka Enberg <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Peng Wang authored and torvalds committed Mar 6, 2019
1 parent 5704a06 commit edde82b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2482,8 +2482,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
stat(s, ALLOC_SLAB);
c->page = page;
*pc = c;
} else
freelist = NULL;
}

return freelist;
}
Expand Down

0 comments on commit edde82b

Please sign in to comment.