mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
slab: warn on zero-length allocations
slub warns on this, and we're working on making kmalloc(0) return NULL. Let's make slab warn as well so our testers detect such callers more rapidly. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4b6f075045
commit
0b44f7a5b5
1 changed files with 1 additions and 0 deletions
|
@ -789,6 +789,7 @@ static inline struct kmem_cache *__find_general_cachep(size_t size,
|
|||
*/
|
||||
BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL);
|
||||
#endif
|
||||
WARN_ON_ONCE(size == 0);
|
||||
while (size > csizep->cs_size)
|
||||
csizep++;
|
||||
|
||||
|
|
Loading…
Reference in a new issue