We don't need to call free_kmem_cache_nodes() immediately when failing
to allocate a kmem_cache_node, because when we return 0,
do_kmem_cache_create() calls __kmem_cache_release() which also performs
free_kmem_cache_nodes().

Signed-off-by: Vlastimil Babka <vba...@suse.cz>
---
 mm/slub.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 
30003763d224c2704a4b93082b8b47af12dcffc5..9f671ec76131c4b0b28d5d568aa45842b5efb6d4
 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5669,10 +5669,8 @@ static int init_kmem_cache_nodes(struct kmem_cache *s)
                n = kmem_cache_alloc_node(kmem_cache_node,
                                                GFP_KERNEL, node);
 
-               if (!n) {
-                       free_kmem_cache_nodes(s);
+               if (!n)
                        return 0;
-               }
 
                init_kmem_cache_node(n);
                s->node[node] = n;

-- 
2.51.0


Reply via email to