summaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 8a85a19d90ef..651a3c60847a 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -125,11 +125,12 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align
}
err = __kmem_cache_create(s, flags);
- if (!err)
+ if (!err) {
+ s->refcount = 1;
list_add(&s->list, &slab_caches);
- else {
+ } else {
kfree(s->name);
kmem_cache_free(kmem_cache, s);
}