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
This commit is contained in:
John Baldwin 2006-11-07 19:03:42 +00:00
parent fe754f8f07
commit fa6f748fe3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164069

View File

@ -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]);