ssb: Fail ssb modinit, if attach of the buses failed.
authorMichael Buesch <mb@bu3sch.de>
Sat, 5 Sep 2009 09:18:47 +0000 (11:18 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Sep 2009 20:31:08 +0000 (16:31 -0400)
SSB modinit should not succeed, if busattach failed.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/ssb/main.c

index 65a1ed951a1daa80abe1c9ac2b091af8664b38ad..8d16cb258ccfc3d89925575a740679dc0d635ffe 100644 (file)
@@ -1358,8 +1358,10 @@ static int __init ssb_modinit(void)
        ssb_buses_lock();
        err = ssb_attach_queued_buses();
        ssb_buses_unlock();
-       if (err)
+       if (err) {
                bus_unregister(&ssb_bustype);
+               goto out;
+       }
 
        err = b43_pci_ssb_bridge_init();
        if (err) {
@@ -1375,7 +1377,7 @@ static int __init ssb_modinit(void)
                /* don't fail SSB init because of this */
                err = 0;
        }
-
+out:
        return err;
 }
 /* ssb must be initialized after PCI but before the ssb drivers.