From patchwork Sat Sep 5 09:18:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 45920 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n859Kdcn014436 for ; Sat, 5 Sep 2009 09:20:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbZIEJUd (ORCPT ); Sat, 5 Sep 2009 05:20:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751345AbZIEJUd (ORCPT ); Sat, 5 Sep 2009 05:20:33 -0400 Received: from bu3sch.de ([62.75.166.246]:49941 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbZIEJUd (ORCPT ); Sat, 5 Sep 2009 05:20:33 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1MjrRi-0008J8-OE; Sat, 05 Sep 2009 09:20:34 +0000 From: Michael Buesch To: linville@tuxdriver.com Subject: [PATCH] ssb: Fail ssb modinit, if attach of the buses failed. Date: Sat, 5 Sep 2009 11:18:47 +0200 User-Agent: KMail/1.9.9 Cc: linux-wireless@vger.kernel.org X-Move-Along: Nothing to see here. No, really... Nothing. MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909051118.49489.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org SSB modinit should not succeed, if busattach failed. Signed-off-by: Michael Buesch --- drivers/ssb/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- wireless-testing.orig/drivers/ssb/main.c +++ wireless-testing/drivers/ssb/main.c @@ -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.