>From f5a04f3db3adaa605e951ae9f46708da63979bda Mon Sep 17 00:00:00 2001 From: Xiaotian Feng Date: Mon, 14 Sep 2009 11:12:27 +0800 Subject: [PATCH] slub: fix kmem_cache wrongly freed in kmem_cache_create commit a0e1d1b move sysfs operations outside of slub_lock, but wrongly freed kmem_cache in any cases (should only free kmem_cache when open failed). Signed-off-by: Xiaotian Feng --- mm/slub.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index b627675..40e12d5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3337,8 +3337,8 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, goto err; } return s; - } - kfree(s); + } else + kfree(s); } up_write(&slub_lock); -- 1.6.2.5