summaryrefslogtreecommitdiffstats
path: root/sys/dev/ipw
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/ipw
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/ipw')
-rw-r--r--sys/dev/ipw/if_ipw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index 4a33fa6..1f9fd07 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -391,7 +391,6 @@ ipw_detach(device_t dev)
if (ifp != NULL) {
bpfdetach(ifp);
ieee80211_ifdetach(ic);
- if_free(ifp);
}
ipw_release(sc);
@@ -403,6 +402,8 @@ ipw_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);
OpenPOWER on IntegriCloud