diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/util.c b/mm/util.c index 13fc88ac8e70..1e2728736398 100644 --- a/mm/util.c +++ b/mm/util.c @@ -587,8 +587,10 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node) return ret; /* Don't even allow crazy sizes */ - if (WARN_ON_ONCE(size > INT_MAX)) + if (unlikely(size > INT_MAX)) { + WARN_ON_ONCE(!(flags & __GFP_NOWARN)); return NULL; + } return __vmalloc_node(size, 1, flags, node, __builtin_return_address(0)); |