* Can't allocate memory when loading a module 2.5.48-bk
@ 2002-11-20 8:43 Greg KH
2002-11-20 9:15 ` Jari Ruusu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Greg KH @ 2002-11-20 8:43 UTC (permalink / raw)
To: rusty; +Cc: linux-kernel
With Linus's latest bk tree (plus some USB patches) I get the following
error when trying to load the parport.o module:
# modprobe parport
FATAL: Error inserting /lib/modules/2.5.48/kernel/parport.o: Cannot allocate memory
Any ideas?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Can't allocate memory when loading a module 2.5.48-bk
2002-11-20 8:43 Can't allocate memory when loading a module 2.5.48-bk Greg KH
@ 2002-11-20 9:15 ` Jari Ruusu
2002-11-20 12:52 ` Juan M. de la Torre
2002-11-24 23:34 ` Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Jari Ruusu @ 2002-11-20 9:15 UTC (permalink / raw)
To: Greg KH; +Cc: rusty, linux-kernel
Greg KH wrote:
> With Linus's latest bk tree (plus some USB patches) I get the following
> error when trying to load the parport.o module:
>
> # modprobe parport
> FATAL: Error inserting /lib/modules/2.5.48/kernel/parport.o: Cannot allocate memory
>
> Any ideas?
Tag some init code with __init
At least stock 2.5.48 tries to happily allocate zero bytes for init section,
and gets a null pointer. That 'error' is then propagated to user space.
Regards,
Jari Ruusu <jari.ruusu@pp.inet.fi>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Can't allocate memory when loading a module 2.5.48-bk
2002-11-20 8:43 Can't allocate memory when loading a module 2.5.48-bk Greg KH
2002-11-20 9:15 ` Jari Ruusu
@ 2002-11-20 12:52 ` Juan M. de la Torre
2002-11-24 23:34 ` Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Juan M. de la Torre @ 2002-11-20 12:52 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
On Wed, Nov 20, 2002 at 12:43:03AM -0800, Greg KH wrote:
> With Linus's latest bk tree (plus some USB patches) I get the following
> error when trying to load the parport.o module:
>
> # modprobe parport
> FATAL: Error inserting /lib/modules/2.5.48/kernel/parport.o: Cannot allocate memory
>
> Any ideas?
Try applying this patch:
--- linux-2.5.48/kernel/module.c.orig Tue Nov 19 20:08:52 2002
+++ linux-2.5.48/kernel/module.c Tue Nov 19 20:37:47 2002
@@ -972,13 +972,15 @@
memset(ptr, 0, mod->core_size);
mod->module_core = ptr;
- ptr = module_alloc(mod->init_size);
- if (!ptr) {
- err = -ENOMEM;
- goto free_core;
- }
- memset(ptr, 0, mod->init_size);
- mod->module_init = ptr;
+ if (mod->init_size) {
+ ptr = module_alloc(mod->init_size);
+ if (!ptr) {
+ err = -ENOMEM;
+ goto free_core;
+ }
+ memset(ptr, 0, mod->init_size);
+ mod->module_init = ptr;
+ }
/* Transfer each section which requires ALLOC, and set sh_offset
fields to absolute addresses. */
--
/jm
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Can't allocate memory when loading a module 2.5.48-bk
2002-11-20 8:43 Can't allocate memory when loading a module 2.5.48-bk Greg KH
2002-11-20 9:15 ` Jari Ruusu
2002-11-20 12:52 ` Juan M. de la Torre
@ 2002-11-24 23:34 ` Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2002-11-24 23:34 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
In message <20021120084303.GB22936@kroah.com> you write:
> With Linus's latest bk tree (plus some USB patches) I get the following
> error when trying to load the parport.o module:
>
> # modprobe parport
> FATAL: Error inserting /lib/modules/2.5.48/kernel/parport.o: Cannot allocate
memory
>
> Any ideas?
No init section, my bad. Should be fixed in 49.
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-11-25 0:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20 8:43 Can't allocate memory when loading a module 2.5.48-bk Greg KH
2002-11-20 9:15 ` Jari Ruusu
2002-11-20 12:52 ` Juan M. de la Torre
2002-11-24 23:34 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox