lkml.org 
[lkml]   [2018]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/slub.c: freelist is ensured to be NULL when new_slab() fails
Date
new_slab_objects() will return immediately if freelist is not NULL.

if (freelist)
return freelist;

One more assignment operation could be avoided.

Signed-off-by: Peng Wang <rocking@whu.edu.cn>
---
mm/slub.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 36c0befeebd8..cf2ef4ababff 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2463,8 +2463,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;
}
--
2.19.1
\
 
 \ /
  Last update: 2018-12-29 07:33    [W:0.646 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site