diff options
author | ru <ru@FreeBSD.org> | 2005-10-13 21:11:20 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-10-13 21:11:20 +0000 |
commit | b9c7add838ccaace56cbb1d065e502e478f92d4e (patch) | |
tree | 42d971c6d541bfdfd3204acba1a4ae6004c37124 /sys/pci | |
parent | 9d4f7296d4bd26d172e55a582c41d028d6dceb40 (diff) | |
download | FreeBSD-src-b9c7add838ccaace56cbb1d065e502e478f92d4e.zip FreeBSD-src-b9c7add838ccaace56cbb1d065e502e478f92d4e.tar.gz |
In detach method, move if_free() after bus_teardown_intr().
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_dc.c | 5 | ||||
-rw-r--r-- | sys/pci/if_pcn.c | 5 | ||||
-rw-r--r-- | sys/pci/if_rl.c | 5 | ||||
-rw-r--r-- | sys/pci/if_sf.c | 5 | ||||
-rw-r--r-- | sys/pci/if_sis.c | 5 | ||||
-rw-r--r-- | sys/pci/if_ste.c | 5 | ||||
-rw-r--r-- | sys/pci/if_ti.c | 4 | ||||
-rw-r--r-- | sys/pci/if_tl.c | 5 | ||||
-rw-r--r-- | sys/pci/if_vr.c | 5 | ||||
-rw-r--r-- | sys/pci/if_wb.c | 5 | ||||
-rw-r--r-- | sys/pci/if_xl.c | 5 |
11 files changed, 32 insertions, 22 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index d4322d5..caaa7e6 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -2356,8 +2356,6 @@ dc_detach(device_t dev) callout_drain(&sc->dc_stat_ch); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->dc_miibus) device_delete_child(dev, sc->dc_miibus); bus_generic_detach(dev); @@ -2369,6 +2367,9 @@ dc_detach(device_t dev) if (sc->dc_res) bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res); + if (ifp) + if_free(ifp); + if (sc->dc_cdata.dc_sbuf != NULL) bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf, sc->dc_smap); if (sc->dc_ldata != NULL) diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 1ec8765..2c780e2 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -677,8 +677,6 @@ pcn_detach(dev) callout_drain(&sc->pcn_stat_callout); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->pcn_miibus) device_delete_child(dev, sc->pcn_miibus); bus_generic_detach(dev); @@ -690,6 +688,9 @@ pcn_detach(dev) if (sc->pcn_res) bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res); + if (ifp) + if_free(ifp); + if (sc->pcn_ldata) { contigfree(sc->pcn_ldata, sizeof(struct pcn_list_data), M_DEVBUF); diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index eae31bc..acea56a 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1019,8 +1019,6 @@ rl_detach(device_t dev) #if 0 sc->suspended = 1; #endif - if (ifp) - if_free(ifp); if (sc->rl_miibus) device_delete_child(dev, sc->rl_miibus); bus_generic_detach(dev); @@ -1032,6 +1030,9 @@ rl_detach(device_t dev) if (sc->rl_res) bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); + if (ifp) + if_free(ifp); + if (sc->rl_tag) { bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf, diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c index 7b2538b..d51641d 100644 --- a/sys/pci/if_sf.c +++ b/sys/pci/if_sf.c @@ -830,8 +830,6 @@ sf_detach(dev) callout_drain(&sc->sf_stat_callout); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->sf_miibus) device_delete_child(dev, sc->sf_miibus); bus_generic_detach(dev); @@ -843,6 +841,9 @@ sf_detach(dev) if (sc->sf_res) bus_release_resource(dev, SF_RES, SF_RID, sc->sf_res); + if (ifp) + if_free(ifp); + if (sc->sf_ldata) contigfree(sc->sf_ldata, sizeof(struct sf_list_data), M_DEVBUF); diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index 0068039..90b666c 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1274,8 +1274,6 @@ sis_detach(device_t dev) callout_drain(&sc->sis_stat_ch); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->sis_miibus) device_delete_child(dev, sc->sis_miibus); bus_generic_detach(dev); @@ -1284,6 +1282,9 @@ sis_detach(device_t dev) bus_teardown_intr(dev, sc->sis_res[1], sc->sis_intrhand); bus_release_resources(dev, sis_res_spec, sc->sis_res); + if (ifp) + if_free(ifp); + if (sc->sis_rx_tag) { bus_dmamap_unload(sc->sis_rx_tag, sc->sis_rx_dmamap); diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index 02815b9..e4ec04e 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -1158,8 +1158,6 @@ ste_detach(dev) callout_drain(&sc->ste_stat_callout); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); bus_generic_detach(dev); @@ -1171,6 +1169,9 @@ ste_detach(dev) if (sc->ste_res) bus_release_resource(dev, STE_RES, STE_RID, sc->ste_res); + if (ifp) + if_free(ifp); + if (sc->ste_ldata) { contigfree(sc->ste_ldata, sizeof(struct ste_list_data), M_DEVBUF); diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 43e9ec6..d4fd437 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -2330,8 +2330,6 @@ ti_detach(dev) ether_ifdetach(ifp); bus_generic_detach(dev); } - if (ifp) - if_free(ifp); ifmedia_removeall(&sc->ifmedia); if (sc->ti_rdata) @@ -2349,6 +2347,8 @@ ti_detach(dev) bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, sc->ti_res); } + if (ifp) + if_free(ifp); #ifdef TI_PRIVATE_JUMBOS if (sc->ti_cdata.ti_jumbo_buf) diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c index 6743912..35f41c8 100644 --- a/sys/pci/if_tl.c +++ b/sys/pci/if_tl.c @@ -1343,8 +1343,6 @@ tl_detach(dev) callout_drain(&sc->tl_stat_callout); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->tl_miibus) device_delete_child(dev, sc->tl_miibus); bus_generic_detach(dev); @@ -1361,6 +1359,9 @@ tl_detach(dev) if (sc->tl_res) bus_release_resource(dev, TL_RES, TL_RID, sc->tl_res); + if (ifp) + if_free(ifp); + mtx_destroy(&sc->tl_mtx); return(0); diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index 8f15b84..c2158d6 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -814,8 +814,6 @@ vr_detach(device_t dev) ether_ifdetach(ifp); VR_LOCK(sc); } - if (ifp) - if_free(ifp); if (sc->vr_miibus) device_delete_child(dev, sc->vr_miibus); bus_generic_detach(dev); @@ -827,6 +825,9 @@ vr_detach(device_t dev) if (sc->vr_res) bus_release_resource(dev, VR_RES, VR_RID, sc->vr_res); + if (ifp) + if_free(ifp); + if (sc->vr_ldata) contigfree(sc->vr_ldata, sizeof(struct vr_list_data), M_DEVBUF); diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index a4a6ef2..b2e8170 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -920,8 +920,6 @@ wb_detach(dev) wb_stop(sc); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->wb_miibus) device_delete_child(dev, sc->wb_miibus); bus_generic_detach(dev); @@ -933,6 +931,9 @@ wb_detach(dev) if (sc->wb_res) bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res); + if (ifp) + if_free(ifp); + if (sc->wb_ldata) { contigfree(sc->wb_ldata, sizeof(struct wb_list_data) + 8, M_DEVBUF); diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 91ff05e..51e143b 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -1717,8 +1717,6 @@ xl_detach(device_t dev) callout_drain(&sc->xl_stat_callout); ether_ifdetach(ifp); } - if (ifp) - if_free(ifp); if (sc->xl_miibus) device_delete_child(dev, sc->xl_miibus); bus_generic_detach(dev); @@ -1734,6 +1732,9 @@ xl_detach(device_t dev) if (sc->xl_res) bus_release_resource(dev, res, rid, sc->xl_res); + if (ifp) + if_free(ifp); + if (sc->xl_mtag) { bus_dmamap_destroy(sc->xl_mtag, sc->xl_tmpmap); bus_dma_tag_destroy(sc->xl_mtag); |