summaryrefslogtreecommitdiff
path: root/mm/slob.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slob.c')
-rw-r--r--mm/slob.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/slob.c b/mm/slob.c
index 45d4ca79933a..5225d28f2694 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -540,6 +540,10 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size,
void kmem_cache_destroy(struct kmem_cache *c)
{
+ mutex_lock(&slab_mutex);
+ list_del(&c->list);
+ mutex_unlock(&slab_mutex);
+
kmemleak_free(c);
if (c->flags & SLAB_DESTROY_BY_RCU)
rcu_barrier();