summaryrefslogtreecommitdiffstats
path: root/sys/dev/wpi
diff options
context:
space:
mode:
authorgavin <gavin@FreeBSD.org>2009-12-14 19:18:02 +0000
committergavin <gavin@FreeBSD.org>2009-12-14 19:18:02 +0000
commita586f5383785927371e457c240f2fbe7e2d1af81 (patch)
treecee7ace8d6a1eff61dbd544923061937ecc2bd52 /sys/dev/wpi
parentfb3e5ec422251b7f02b1b44f79c1bc4ae3da20b1 (diff)
downloadFreeBSD-src-a586f5383785927371e457c240f2fbe7e2d1af81.zip
FreeBSD-src-a586f5383785927371e457c240f2fbe7e2d1af81.tar.gz
Don't panic on failure to attach if we fail before or during the
if_alloc() of ifp. This fixes the panic reported in the PR, but not the attach failure. PR: kern/139079 Tested by: Steven Noonan <steven uplinklabs.net> Reviewed by: thompsa Approved by: ed (mentor) MFC after: 2 weeks`
Diffstat (limited to 'sys/dev/wpi')
-rw-r--r--sys/dev/wpi/if_wpi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index 85812375..1797c2d 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -713,13 +713,14 @@ wpi_detach(device_t dev)
{
struct wpi_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct ieee80211com *ic;
int ac;
- ieee80211_draintask(ic, &sc->sc_restarttask);
- ieee80211_draintask(ic, &sc->sc_radiotask);
-
if (ifp != NULL) {
+ ic = ifp->if_l2com;
+
+ ieee80211_draintask(ic, &sc->sc_restarttask);
+ ieee80211_draintask(ic, &sc->sc_radiotask);
wpi_stop(sc);
callout_drain(&sc->watchdog_to);
callout_drain(&sc->calib_to);
OpenPOWER on IntegriCloud