summaryrefslogtreecommitdiffstats
path: root/sys/dev/vge/if_vge.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/vge/if_vge.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/vge/if_vge.c')
-rw-r--r--sys/dev/vge/if_vge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index 60d8cdc..0780bc5 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -1123,8 +1123,6 @@ vge_detach(dev)
ifp->if_flags &= ~IFF_UP;
ether_ifdetach(ifp);
}
- if (ifp)
- if_free(ifp);
if (sc->vge_miibus)
device_delete_child(dev, sc->vge_miibus);
bus_generic_detach(dev);
@@ -1136,6 +1134,8 @@ vge_detach(dev)
if (sc->vge_res)
bus_release_resource(dev, SYS_RES_MEMORY,
VGE_PCI_LOMEM, sc->vge_res);
+ if (ifp)
+ if_free(ifp);
/* Unload and free the RX DMA ring memory and map */
OpenPOWER on IntegriCloud