From 601d39d00c2af206d10d1252132a85316d95499a Mon Sep 17 00:00:00 2001 From: Joonsoo Kim Date: Fri, 11 May 2012 00:32:59 +0900 Subject: [PATCH] slub: fix a possible memory leak Memory allocated by kstrdup should be freed, when kmalloc(kmem_size, GFP_KERNEL) is failed. Acked-by: Christoph Lameter Acked-by: David Rientjes Signed-off-by: Joonsoo Kim Signed-off-by: Pekka Enberg --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 18bf13eac54b..60119f78ccc0 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3968,9 +3968,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, } return s; } - kfree(n); kfree(s); } + kfree(n); err: up_write(&slub_lock); -- 2.39.5