diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c index f80473905653..5bd68f96b859 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5541,8 +5541,10 @@ static int sysfs_slab_add(struct kmem_cache *s) s->kobj.kset = cache_kset(s); err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name); - if (err) + if (err) { + kobject_put(&s->kobj); goto out; + } err = sysfs_create_group(&s->kobj, &slab_attr_group); if (err) |