From 4e70215e6bf590140205774753c8b0a1f1fe9a36 Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 19 Sep 2005 03:10:21 +0000 Subject: 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. --- sys/dev/lge/if_lge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/lge') diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index f1d73d4..9ba8542 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -627,7 +627,6 @@ lge_detach(dev) lge_reset(sc); lge_stop(sc); ether_ifdetach(ifp); - if_free(ifp); bus_generic_detach(dev); device_delete_child(dev, sc->lge_miibus); @@ -637,6 +636,7 @@ lge_detach(dev) bus_release_resource(dev, LGE_RES, LGE_RID, sc->lge_res); contigfree(sc->lge_ldata, sizeof(struct lge_list_data), M_DEVBUF); + if_free(ifp); lge_free_jumbo_mem(sc); splx(s); -- cgit v1.1