mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
modules: don't hand 0 to vmalloc.
In commitd0a21265dfDavid Rientjes unified various archs' module_alloc implementation (including x86) and removed the graduitous shortcut for size == 0. Then, in commitde7d2b567d, Joe Perches added a warning for zero-length vmallocs, which can happen without kallsyms on modules with no init sections (eg. zlib_deflate). Fix this once and for all; the module code has to handle zero length anyway, so get it right at the caller and remove the now-gratuitous checks within the arch-specific module_alloc implementations. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42608 Reported-by: Conrad Kostecki <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
54523ec71f
commit
82fab442f5
6 changed files with 18 additions and 28 deletions
|
|
@ -42,8 +42,6 @@ void *module_alloc(unsigned long size)
|
|||
int i = 0;
|
||||
int npages;
|
||||
|
||||
if (size == 0)
|
||||
return NULL;
|
||||
npages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
pages = kmalloc(npages * sizeof(struct page *), GFP_KERNEL);
|
||||
if (pages == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue