summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-11-07 19:03:42 +0000
committerjhb <jhb@FreeBSD.org>2006-11-07 19:03:42 +0000
commit7b35dc71a30039dea921d88e338d3677bb6d87ad (patch)
tree3cc1ada3ac499ceee043333c78c9d04a3d36daaf /sys/dev/iwi
parentfa55300f19a1628feffcbd0f1e4dc7409cf8a9d8 (diff)
downloadFreeBSD-src-7b35dc71a30039dea921d88e338d3677bb6d87ad.zip
FreeBSD-src-7b35dc71a30039dea921d88e338d3677bb6d87ad.tar.gz
Fix some edge cases in detach (including attach failures):
- Only call iwi_stop() if we got far enough along in iwi_attach() to alloc an ifnet. - Release the firmware after stopping the interface and detaching the ifnet. MFC after: 1 month Reviewed by: sam
Diffstat (limited to 'sys/dev/iwi')
-rw-r--r--sys/dev/iwi/if_iwi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 2451281..c08afd6 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -488,13 +488,12 @@ iwi_detach(device_t dev)
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = ic->ic_ifp;
- iwi_stop(sc);
- iwi_put_firmware(sc);
-
if (ifp != NULL) {
+ iwi_stop(sc);
bpfdetach(ifp);
ieee80211_ifdetach(ic);
}
+ iwi_put_firmware(sc);
iwi_free_cmd_ring(sc, &sc->cmdq);
iwi_free_tx_ring(sc, &sc->txq[0]);
OpenPOWER on IntegriCloud