From 2cae64a1951903efd35d4233a1cca5f34d40ac54 Mon Sep 17 00:00:00 2001 From: cegger Date: Sun, 26 Apr 2009 10:45:19 +0000 Subject: [PATCH] check error code from bwi_attach() --- sys/dev/pci/if_bwi_pci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_bwi_pci.c b/sys/dev/pci/if_bwi_pci.c index 29b9cc7400ee..68da4284f31e 100644 --- a/sys/dev/pci/if_bwi_pci.c +++ b/sys/dev/pci/if_bwi_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bwi_pci.c,v 1.7 2009/04/26 10:26:54 cegger Exp $ */ +/* $NetBSD: if_bwi_pci.c,v 1.8 2009/04/26 10:45:19 cegger Exp $ */ /* $OpenBSD: if_bwi_pci.c,v 1.6 2008/02/14 22:10:02 brad Exp $ */ /* @@ -25,7 +25,7 @@ #include "bpfilter.h" #include -__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.7 2009/04/26 10:26:54 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.8 2009/04/26 10:45:19 cegger Exp $"); #include #include @@ -111,6 +111,7 @@ bwi_pci_attach(device_t parent, device_t self, void *aux) const char *intrstr = NULL; pci_intr_handle_t ih; pcireg_t memtype, reg; + int error = 0; aprint_naive("\n"); aprint_normal(": Broadcom Wireless"); @@ -171,7 +172,9 @@ bwi_pci_attach(device_t parent, device_t self, void *aux) if (!pmf_device_register(self, bwi_suspend, bwi_resume)) aprint_error_dev(self, "couldn't establish power handler\n"); - bwi_attach(sc); + error = bwi_attach(sc); + if (error) + goto fail; return; fail: