diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-10 18:08:33 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-13 21:36:43 -0500 |
commit | 82fab442f5322b016f72891c0db2436c6a6c20b7 (patch) | |
tree | 1b55bbf22569cf721c4bc13dc8f96652bad50a26 /arch/parisc/kernel/module.c | |
parent | 54523ec71f8ce99accae97c74152f14f261f7e18 (diff) |
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/parisc/kernel/module.c')
-rw-r--r-- | arch/parisc/kernel/module.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 5e34ccf39a49..2a625fb063e1 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -214,8 +214,6 @@ static inline int reassemble_22(int as22) | |||
214 | 214 | ||
215 | void *module_alloc(unsigned long size) | 215 | void *module_alloc(unsigned long size) |
216 | { | 216 | { |
217 | if (size == 0) | ||
218 | return NULL; | ||
219 | /* using RWX means less protection for modules, but it's | 217 | /* using RWX means less protection for modules, but it's |
220 | * easier than trying to map the text, data, init_text and | 218 | * easier than trying to map the text, data, init_text and |
221 | * init_data correctly */ | 219 | * init_data correctly */ |