diff --git a/mm/slab_common.c b/mm/slab_common.c index c26829fe4e37ea0b38ce6c26fef84a7dcb528eee..bde04a699ab63e2babef549f131ea36156ec474d 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -640,6 +640,9 @@ void kmem_cache_destroy(struct kmem_cache *s) bool need_rcu_barrier = false; bool busy = false; + if (unlikely(!s)) + return; + BUG_ON(!is_root_cache(s)); get_online_cpus();