summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/slab_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index c26829fe4e37..bde04a699ab6 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();