[PATCH] init. mca_bus_type even if !MCA_bus

From: Randy.Dunlap
Date: Mon May 17 2004 - 16:56:07 EST



// Linux 2.6.6
// need to call mca_system_init() to register MCA bus struct,
// otherwise find_mca_adapter() oopses with a NULL ptr.
// Fixes this oops reported last week:
// http://marc.theaimsgroup.com/?l=linux-kernel&m=108455738606747&w=2
// Thanks to James Bottomley for pointing this out.

diffstat:=
arch/i386/kernel/mca.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)


diff -Naurp ./arch/i386/kernel/mca.c~check_mca_bus ./arch/i386/kernel/mca.c
--- ./arch/i386/kernel/mca.c~check_mca_bus 2004-05-09 19:33:05.000000000 -0700
+++ ./arch/i386/kernel/mca.c 2004-05-17 14:50:32.000000000 -0700
@@ -258,16 +258,16 @@ static int __init mca_init(void)

/* Make sure the MCA bus is present */

- if(!MCA_bus)
- return -ENODEV;
-
- printk(KERN_INFO "Micro Channel bus detected.\n");
-
- if(mca_system_init()) {
+ if (mca_system_init()) {
printk(KERN_ERR "MCA bus system initialisation failed\n");
return -ENODEV;
}

+ if (!MCA_bus)
+ return -ENODEV;
+
+ printk(KERN_INFO "Micro Channel bus detected.\n");
+
/* All MCA systems have at least a primary bus */
bus = mca_attach_bus(MCA_PRIMARY_BUS);
if (!bus)


--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/