]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ipmi_msghandler module load failure fix
authorKhalid Aziz <khalid_aziz@hp.com>
Wed, 28 Jul 2004 16:03:11 +0000 (09:03 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 28 Jul 2004 16:03:11 +0000 (09:03 -0700)
On a 2.6.7 kernel, when I try to modprobe ipmi_msghandler, it fails to load
with following message:

FATAL: Error inserting ipmi_msghandler (/lib/modules/2.6.7/kernel/drivers/char/ipmi/ipmi_msghandler.ko): Invalid module format

And there is an error message in dmesg:

ipmi_msghandler: init symbol 0xa000000200058080 used in module code at a000000200031b32

What I have been able to determine is that ipmi_msghandler.c defines
ipmi_init_msghandler() as the module_init() routine and then it also calls
ipmi_init_msghandler() diretcly from couple of other places.  This does not
seem to be okay in 2.6.7 kernel.  I was able to fix this by defining a new
module_init routine which in turn calls ipmi_init_msghandler().  I also
removed __init from ipmi_init_msghandler() since it gets called from
ipmi_open() on an open of the ipmi device file.  So I would think we want
to keep ipmi_init_msghandler() around even after initialization.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/ipmi/ipmi_msghandler.c

index b691478ca40c3897fa8a6016ac7df0aee44627db..83ae6f5309e218a43310efde4fa921eb6f587058 100644 (file)
@@ -3098,7 +3098,7 @@ static struct notifier_block panic_block = {
        200   /* priority: INT_MAX >= x >= 0 */
 };
 
-static __init int ipmi_init_msghandler(void)
+static int ipmi_init_msghandler(void)
 {
        int i;
 
@@ -3133,6 +3133,12 @@ static __init int ipmi_init_msghandler(void)
        return 0;
 }
 
+static __init int ipmi_init_msghandler_mod(void)
+{
+       ipmi_init_msghandler();
+       return 0;
+}
+
 static __exit void cleanup_ipmi(void)
 {
        int count;
@@ -3169,7 +3175,7 @@ static __exit void cleanup_ipmi(void)
 }
 module_exit(cleanup_ipmi);
 
-module_init(ipmi_init_msghandler);
+module_init(ipmi_init_msghandler_mod);
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(ipmi_alloc_recv_msg);