summaryrefslogtreecommitdiffstats
path: root/sys/dev/txp/if_txp.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/txp/if_txp.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/txp/if_txp.c')
-rw-r--r--sys/dev/txp/if_txp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 0a35070..03bd0b4 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -392,9 +392,6 @@ txp_release_resources(sc)
dev = sc->sc_dev;
- if (sc->sc_ifp)
- if_free(sc->sc_ifp);
-
if (sc->sc_intrhand != NULL)
bus_teardown_intr(dev, sc->sc_irq, sc->sc_intrhand);
@@ -407,6 +404,9 @@ txp_release_resources(sc)
if (sc->sc_ldata != NULL)
contigfree(sc->sc_ldata, sizeof(struct txp_ldata), M_DEVBUF);
+ if (sc->sc_ifp)
+ if_free(sc->sc_ifp);
+
return;
}
OpenPOWER on IntegriCloud