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/ray/if_ray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/ray') diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index 9ea6680..adc48beb 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -604,7 +604,6 @@ ray_detach(device_t dev) sc->sc_c.np_havenet = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ether_ifdetach(ifp); - if_free(ifp); /* * Stop the runq and wake up anyone sleeping for us. @@ -627,6 +626,7 @@ ray_detach(device_t dev) * Release resources */ ray_res_release(sc); + if_free(ifp); RAY_DPRINTF(sc, RAY_DBG_STOP, "unloading complete"); splx(s); -- cgit v1.1