From 15b185341d71185dedca7884be9f02c83fd444f3 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Mon, 22 Feb 2016 00:58:04 +0000 Subject: [PATCH] ifnet lock was changed to use sx(9) long time ago. Don't hold a driver lock for if_free(9). --- sys/dev/msk/if_msk.c | 4 ++-- sys/dev/sk/if_sk.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index cc6d8e45ac2e..ffbe36eb423a 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -2059,11 +2059,11 @@ msk_detach(device_t dev) msk_txrx_dma_free(sc_if); bus_generic_detach(dev); - if (ifp) - if_free(ifp); sc = sc_if->msk_softc; sc->msk_if[sc_if->msk_port] = NULL; MSK_IF_UNLOCK(sc_if); + if (ifp) + if_free(ifp); return (0); } diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 2678390eb8e0..bdf4365c2f17 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1833,8 +1833,6 @@ sk_detach(dev) ether_ifdetach(ifp); SK_IF_LOCK(sc_if); } - if (ifp) - if_free(ifp); /* * We're generally called from skc_detach() which is using * device_delete_child() to get to here. It's already trashed @@ -1848,6 +1846,8 @@ sk_detach(dev) sk_dma_jumbo_free(sc_if); sk_dma_free(sc_if); SK_IF_UNLOCK(sc_if); + if (ifp) + if_free(ifp); return(0); }