summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2005-03-16 16:39:04 +0000
committermux <mux@FreeBSD.org>2005-03-16 16:39:04 +0000
commitf472dda708da18436fce04e1b640051e98b0bcf9 (patch)
treeb6c0f92d87717925ade5b8b9cec0e7438810866c /sys
parent3d5967d36501793e41068bed0ef3fd32fa72411a (diff)
downloadFreeBSD-src-f472dda708da18436fce04e1b640051e98b0bcf9.zip
FreeBSD-src-f472dda708da18436fce04e1b640051e98b0bcf9.tar.gz
Unload and destroy the TX DMA maps before destroying the DMA tag
they're attached to, not after. Spotted by: Coverity via sam
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fxp/if_fxp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index f61f507..a6f9004 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -855,9 +855,6 @@ fxp_release(struct fxp_softc *sc)
bus_dmamap_destroy(sc->fxp_mtag, rxp->rx_map);
}
bus_dmamap_destroy(sc->fxp_mtag, sc->spare_map);
- bus_dma_tag_destroy(sc->fxp_mtag);
- }
- if (sc->fxp_stag) {
for (i = 0; i < FXP_NTXCB; i++) {
txp = &sc->fxp_desc.tx_list[i];
if (txp->tx_mbuf != NULL) {
@@ -868,8 +865,10 @@ fxp_release(struct fxp_softc *sc)
}
bus_dmamap_destroy(sc->fxp_mtag, txp->tx_map);
}
- bus_dma_tag_destroy(sc->fxp_stag);
+ bus_dma_tag_destroy(sc->fxp_mtag);
}
+ if (sc->fxp_stag)
+ bus_dma_tag_destroy(sc->fxp_stag);
if (sc->cbl_tag)
bus_dma_tag_destroy(sc->cbl_tag);
if (sc->mcs_tag)
OpenPOWER on IntegriCloud