From: Andrew Morton That could make the machine unusable. Cc: Christoph Lameter Signed-off-by: Andrew Morton --- include/linux/slub_def.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN include/linux/slub_def.h~slub-allocate-smallest-object-size-if-the-user-asks-for-0-bytes-fix include/linux/slub_def.h --- a/include/linux/slub_def.h~slub-allocate-smallest-object-size-if-the-user-asks-for-0-bytes-fix +++ a/include/linux/slub_def.h @@ -84,7 +84,7 @@ static inline int kmalloc_index(int size * We should return 0 if size == 0 but we use the smallest object * here for SLAB legacy reasons. */ - WARN_ON(size == 0); + WARN_ON_ONCE(size == 0); if (size > 64 && size <= 96) return 1; _