]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - mm/vmalloc.c
mm: make vb_alloc() more foolproof
authorJan Kara <jack@suse.cz>
Tue, 31 Jul 2012 23:41:37 +0000 (16:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Aug 2012 01:42:39 +0000 (18:42 -0700)
commitaa91c4d898c062804f4d0a5da6d8ab013cd0e868
treeb4472de48394ca8aafac72e2e97eb9a259fd8111
parent92ca922f0a19145f2dcc99d84fe656fa55b52c2e
mm: make vb_alloc() more foolproof

If someone calls vb_alloc() (or vm_map_ram() for that matter) to allocate
0 bytes (0 pages), get_order() returns BITS_PER_LONG - PAGE_CACHE_SHIFT
and interesting stuff happens.  So make debugging such problems easier and
warn about 0-size allocation.

[akpm@linux-foundation.org: use WARN_ON-return-value feature]
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmalloc.c