summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi/if_iwi.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-09-19 03:10:21 +0000
committerimp <imp@FreeBSD.org>2005-09-19 03:10:21 +0000
commit4e70215e6bf590140205774753c8b0a1f1fe9a36 (patch)
treec3358cebc77043ea8b2a3a5036b02dad6a674b7e /sys/dev/iwi/if_iwi.c
parent37a0bbb7e543c6b2a2f055d676d5a94f781d7738 (diff)
downloadFreeBSD-src-4e70215e6bf590140205774753c8b0a1f1fe9a36.zip
FreeBSD-src-4e70215e6bf590140205774753c8b0a1f1fe9a36.tar.gz
Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
Diffstat (limited to 'sys/dev/iwi/if_iwi.c')
-rw-r--r--sys/dev/iwi/if_iwi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 420d2ae..d353a03 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -467,7 +467,6 @@ iwi_detach(device_t dev)
if (ifp != NULL) {
bpfdetach(ifp);
ieee80211_ifdetach(ic);
- if_free(ifp);
}
iwi_free_cmd_ring(sc, &sc->cmdq);
@@ -485,6 +484,8 @@ iwi_detach(device_t dev)
if (sc->mem != NULL)
bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem);
+ if (ifp != NULL)
+ if_free(ifp);
mtx_destroy(&sc->sc_mtx);
return 0;
OpenPOWER on IntegriCloud