diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 8 | ||||
-rw-r--r-- | mm/slub.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index e19544043fdf..7d60cfc2b30f 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -404,8 +404,12 @@ EXPORT_SYMBOL(kmem_cache_create); */ static void kmem_cache_release(struct kmem_cache *s) { - sysfs_slab_unlink(s); - sysfs_slab_release(s); + if (slab_state >= FULL) { + sysfs_slab_unlink(s); + sysfs_slab_release(s); + } else { + slab_kmem_cache_release(s); + } } #else static void kmem_cache_release(struct kmem_cache *s) diff --git a/mm/slub.c b/mm/slub.c index e28929e6e252..0e02e072693b 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -6794,14 +6794,12 @@ out_del_kobj: void sysfs_slab_unlink(struct kmem_cache *s) { - if (slab_state >= FULL) - kobject_del(&s->kobj); + kobject_del(&s->kobj); } void sysfs_slab_release(struct kmem_cache *s) { - if (slab_state >= FULL) - kobject_put(&s->kobj); + kobject_put(&s->kobj); } /* |