Commit 64e67fb0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] initialise mca_bus_type even if !MCA_bus

From: "Randy.Dunlap" <rddunlap@osdl.org>

We need to call mca_system_init() to register MCA bus struct, otherwise
find_mca_adapter() oopses with a NULL ptr dereference.

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.
parent a856abc9
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment