diff --git a/mm/slab_common.c b/mm/slab_common.c index ff3218a0f5e14029aab5c23dd323f447d2a86173..2d414508e9ecb32e64df911c72bf0dd2682b87b8 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -373,8 +373,10 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) { int index; - if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE)) + if (size > KMALLOC_MAX_SIZE) { + WARN_ON_ONCE(!(flags & __GFP_NOWARN)); return NULL; + } if (size <= 192) { if (!size)