diff --git a/mm/slab_common.c b/mm/slab_common.c index 4d3c2e76d1ba5..39e382acb0b86 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -850,7 +850,8 @@ static void flush_memcg_workqueue(struct kmem_cache *s) * deactivates the memcg kmem_caches through workqueue. Make sure all * previous workitems on workqueue are processed. */ - flush_workqueue(memcg_kmem_cache_wq); + if (likely(memcg_kmem_cache_wq)) + flush_workqueue(memcg_kmem_cache_wq); } #else static inline int shutdown_memcg_caches(struct kmem_cache *s)