diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c index ad113c431e3..c9adfce0040 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2907,7 +2907,8 @@ void *__kmalloc(size_t size, unsigned int __nocast flags) * functions. */ cachep = __find_general_cachep(size, flags); - BUG_ON(!cachep); /* Allocation size too large for kmalloc */ + if (unlikely(cachep == NULL)) + return NULL; return __cache_alloc(cachep, flags); } EXPORT_SYMBOL(__kmalloc); |