aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-12-10 18:08:33 -0500
committerRusty Russell <rusty@rustcorp.com.au>2012-12-13 21:36:43 -0500
commit82fab442f5322b016f72891c0db2436c6a6c20b7 (patch)
tree1b55bbf22569cf721c4bc13dc8f96652bad50a26 /arch/sparc/kernel
parent54523ec71f8ce99accae97c74152f14f261f7e18 (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/sparc/kernel')
-rw-r--r--arch/sparc/kernel/module.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index f1ddc0d23679..4435488ebe25 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -43,10 +43,6 @@ void *module_alloc(unsigned long size)
43{ 43{
44 void *ret; 44 void *ret;
45 45
46 /* We handle the zero case fine, unlike vmalloc */
47 if (size == 0)
48 return NULL;
49
50 ret = module_map(size); 46 ret = module_map(size);
51 if (ret) 47 if (ret)
52 memset(ret, 0, size); 48 memset(ret, 0, size);