mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
modules: don't hand 0 to vmalloc.
In commitd0a21265df
David 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 <ConiKost@gmx.de> Cc: David Rientjes <rientjes@google.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
54523ec71f
commit
82fab442f5
6 changed files with 18 additions and 28 deletions
|
@ -43,10 +43,6 @@ void *module_alloc(unsigned long size)
|
|||
{
|
||||
void *ret;
|
||||
|
||||
/* We handle the zero case fine, unlike vmalloc */
|
||||
if (size == 0)
|
||||
return NULL;
|
||||
|
||||
ret = module_map(size);
|
||||
if (ret)
|
||||
memset(ret, 0, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue