summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-10-06 17:02:22 +0000
committermikeb <mikeb@openbsd.org>2016-10-06 17:02:22 +0000
commit4ea1b78ebdb356ac6526ba16382183f249e7c12d (patch)
tree327609f96f5d019441b8eb3b3149044412db82dd
parentSeparate splsoftnet() from variable initialization. (diff)
downloadwireguard-openbsd-4ea1b78ebdb356ac6526ba16382183f249e7c12d.tar.xz
wireguard-openbsd-4ea1b78ebdb356ac6526ba16382183f249e7c12d.zip
Fold the bus_dmamap_destroy into the loop above
-rw-r--r--sys/dev/pv/if_xnf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c
index 5e5dd4148a8..adec5ec6afa 100644
--- a/sys/dev/pv/if_xnf.c
+++ b/sys/dev/pv/if_xnf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xnf.c,v 1.40 2016/10/06 17:00:25 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.41 2016/10/06 17:02:22 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
@@ -1015,17 +1015,13 @@ xnf_tx_ring_destroy(struct xnf_softc *sc)
bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_dmap[i], 0, 0,
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, sc->sc_tx_dmap[i]);
+ bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_dmap[i]);
+ sc->sc_tx_dmap[i] = NULL;
if (sc->sc_tx_buf[i] == NULL)
continue;
m_free(sc->sc_tx_buf[i]);
sc->sc_tx_buf[i] = NULL;
}
- for (i = 0; i < XNF_TX_DESC; i++) {
- if (sc->sc_tx_dmap[i] == NULL)
- continue;
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_dmap[i]);
- sc->sc_tx_dmap[i] = NULL;
- }
if (sc->sc_tx_rmap) {
bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);