diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-11 00:08:33 +0100 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-14 03:36:43 +0100 |
commit | 82fab442f5322b016f72891c0db2436c6a6c20b7 (patch) | |
tree | 1b55bbf22569cf721c4bc13dc8f96652bad50a26 /arch/tile | |
parent | module: Remove a extra null character at the top of module->strtab. (diff) | |
download | linux-82fab442f5322b016f72891c0db2436c6a6c20b7.tar.xz linux-82fab442f5322b016f72891c0db2436c6a6c20b7.zip |
modules: don't hand 0 to vmalloc.
In commit d0a21265dfb5fa8a David Rientjes unified various archs'
module_alloc implementation (including x86) and removed the graduitous
shortcut for size == 0.
Then, in commit de7d2b567d040e3b, 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 <ConiKost@gmx.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/kernel/module.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index 243ffebe38d6..4918d91bc3a6 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c @@ -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) |