As davem points out, this wasn't such a great idea. There may be some code
which does:
size = 1024*1024;
while (kmalloc(size, ...) == 0)
size /= 2;
which will now explode.
Cc: "David S. Miller" <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
* 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);