diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/advansys/adwcam.c | 2 | ||||
-rw-r--r-- | sys/dev/an/if_an.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/ata-dma.c | 4 | ||||
-rw-r--r-- | sys/dev/buslogic/bt.c | 2 | ||||
-rw-r--r-- | sys/dev/dpt/dpt_scsi.c | 1 | ||||
-rw-r--r-- | sys/dev/hifn/hifn7751.c | 3 | ||||
-rw-r--r-- | sys/dev/malo/if_malo.c | 10 | ||||
-rw-r--r-- | sys/dev/malo/if_malohal.c | 18 | ||||
-rw-r--r-- | sys/dev/mwl/if_mwl.c | 21 | ||||
-rw-r--r-- | sys/dev/mwl/mwlhal.c | 13 | ||||
-rw-r--r-- | sys/dev/safe/safe.c | 15 | ||||
-rw-r--r-- | sys/dev/sym/sym_hipd.c | 6 | ||||
-rw-r--r-- | sys/dev/trm/trm.c | 17 | ||||
-rw-r--r-- | sys/dev/tx/if_tx.c | 3 | ||||
-rw-r--r-- | sys/dev/ubsec/ubsec.c | 11 |
15 files changed, 18 insertions, 116 deletions
diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c index d925045..cb38a61 100644 --- a/sys/dev/advansys/adwcam.c +++ b/sys/dev/advansys/adwcam.c @@ -777,7 +777,6 @@ adw_free(struct adw_softc *adw) case 7: bus_dmamem_free(adw->acb_dmat, adw->acbs, adw->acb_dmamap); - bus_dmamap_destroy(adw->acb_dmat, adw->acb_dmamap); case 6: bus_dma_tag_destroy(adw->acb_dmat); case 5: @@ -785,7 +784,6 @@ adw_free(struct adw_softc *adw) case 4: bus_dmamem_free(adw->carrier_dmat, adw->carriers, adw->carrier_dmamap); - bus_dmamap_destroy(adw->carrier_dmat, adw->carrier_dmamap); case 3: bus_dma_tag_destroy(adw->carrier_dmat); case 2: diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index ee9282e..e9c0ed5 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -483,10 +483,6 @@ an_dma_malloc(struct an_softc *sc, bus_size_t size, struct an_dma_alloc *dma, { int r; - r = bus_dmamap_create(sc->an_dtag, BUS_DMA_NOWAIT, &dma->an_dma_map); - if (r != 0) - goto fail_0; - r = bus_dmamem_alloc(sc->an_dtag, (void**) &dma->an_dma_vaddr, BUS_DMA_NOWAIT, &dma->an_dma_map); if (r != 0) @@ -507,9 +503,6 @@ fail_2: bus_dmamap_unload(sc->an_dtag, dma->an_dma_map); fail_1: bus_dmamem_free(sc->an_dtag, dma->an_dma_vaddr, dma->an_dma_map); -fail_0: - bus_dmamap_destroy(sc->an_dtag, dma->an_dma_map); - dma->an_dma_map = NULL; return (r); } @@ -519,7 +512,6 @@ an_dma_free(struct an_softc *sc, struct an_dma_alloc *dma) bus_dmamap_unload(sc->an_dtag, dma->an_dma_map); bus_dmamem_free(sc->an_dtag, dma->an_dma_vaddr, dma->an_dma_map); dma->an_dma_vaddr = 0; - bus_dmamap_destroy(sc->an_dtag, dma->an_dma_map); } /* diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index 6236f44..ee41c60 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -224,11 +224,9 @@ ata_dmafree(device_t dev) bus_dmamap_unload(slot->sg_tag, slot->sg_map); slot->sg_bus = 0; } - if (slot->sg_map) { + if (slot->sg) { bus_dmamem_free(slot->sg_tag, slot->sg, slot->sg_map); - bus_dmamap_destroy(slot->sg_tag, slot->sg_map); slot->sg = NULL; - slot->sg_map = NULL; } if (slot->data_map) { bus_dmamap_destroy(slot->data_tag, slot->data_map); diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c index b24442e..5916fb2 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -246,7 +246,6 @@ bt_free_softc(device_t dev) case 6: bus_dmamem_free(bt->ccb_dmat, bt->bt_ccb_array, bt->ccb_dmamap); - bus_dmamap_destroy(bt->ccb_dmat, bt->ccb_dmamap); /* FALLTHROUGH */ case 5: bus_dma_tag_destroy(bt->ccb_dmat); @@ -257,7 +256,6 @@ bt_free_softc(device_t dev) case 3: bus_dmamem_free(bt->mailbox_dmat, bt->in_boxes, bt->mailbox_dmamap); - bus_dmamap_destroy(bt->mailbox_dmat, bt->mailbox_dmamap); /* FALLTHROUGH */ case 2: bus_dma_tag_destroy(bt->buffer_dmat); diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index 3481cdc..51f9e73d 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -1149,7 +1149,6 @@ dpt_free(struct dpt_softc *dpt) case 4: bus_dmamem_free(dpt->dccb_dmat, dpt->dpt_dccbs, dpt->dccb_dmamap); - bus_dmamap_destroy(dpt->dccb_dmat, dpt->dccb_dmamap); case 3: bus_dma_tag_destroy(dpt->dccb_dmat); case 2: diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 8954242..e9d47a1 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -463,7 +463,6 @@ hifn_attach(device_t dev) BUS_DMA_NOWAIT)) { device_printf(dev, "cannot load dma map\n"); bus_dmamem_free(sc->sc_dmat, kva, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); goto fail_io1; } @@ -603,7 +602,6 @@ fail_intr2: fail_mem: bus_dmamap_unload(sc->sc_dmat, sc->sc_dmamap); bus_dmamem_free(sc->sc_dmat, sc->sc_dma, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); /* Turn off DMA polling */ @@ -653,7 +651,6 @@ hifn_detach(device_t dev) bus_dmamap_unload(sc->sc_dmat, sc->sc_dmamap); bus_dmamem_free(sc->sc_dmat, sc->sc_dma, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); bus_release_resource(dev, SYS_RES_MEMORY, HIFN_BAR1, sc->sc_bar1res); diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index 7817462..db8f61d 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -496,13 +496,6 @@ malo_desc_setup(struct malo_softc *sc, const char *name, } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); if (error != 0) { @@ -530,8 +523,6 @@ malo_desc_setup(struct malo_softc *sc, const char *name, fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -632,7 +623,6 @@ malo_desc_cleanup(struct malo_softc *sc, struct malo_descdma *dd) { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); diff --git a/sys/dev/malo/if_malohal.c b/sys/dev/malo/if_malohal.c index 117ccde..8a77943 100644 --- a/sys/dev/malo/if_malohal.c +++ b/sys/dev/malo/if_malohal.c @@ -137,13 +137,6 @@ malo_hal_attach(device_t dev, uint16_t devid, } /* allocate descriptors */ - error = bus_dmamap_create(mh->mh_dmat, BUS_DMA_NOWAIT, &mh->mh_dmamap); - if (error != 0) { - device_printf(dev, "unable to create dmamap for cmd buffers, " - "error %u\n", error); - goto fail; - } - error = bus_dmamem_alloc(mh->mh_dmat, (void**) &mh->mh_cmdbuf, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mh->mh_dmamap); @@ -166,13 +159,9 @@ malo_hal_attach(device_t dev, uint16_t devid, return (mh); fail: - if (mh->mh_dmamap != NULL) { - bus_dmamap_unload(mh->mh_dmat, mh->mh_dmamap); - if (mh->mh_cmdbuf != NULL) - bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, - mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); - } + if (mh->mh_cmdbuf != NULL) + bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, + mh->mh_dmamap); if (mh->mh_dmat) bus_dma_tag_destroy(mh->mh_dmat); free(mh, M_DEVBUF); @@ -592,7 +581,6 @@ malo_hal_detach(struct malo_hal *mh) { bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); bus_dma_tag_destroy(mh->mh_dmat); mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 67fba35..b50e1a9 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -2041,13 +2041,6 @@ mwl_desc_setup(struct mwl_softc *sc, const char *name, } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); @@ -2077,8 +2070,6 @@ mwl_desc_setup(struct mwl_softc *sc, const char *name, fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -2090,7 +2081,6 @@ mwl_desc_cleanup(struct mwl_softc *sc, struct mwl_descdma *dd) { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); @@ -2229,9 +2219,8 @@ mwl_rxdma_setup(struct mwl_softc *sc) NULL, /* lockfunc */ NULL, /* lockarg */ &sc->sc_rxdmat); - error = bus_dmamap_create(sc->sc_rxdmat, BUS_DMA_NOWAIT, &sc->sc_rxmap); if (error != 0) { - if_printf(ifp, "could not create rx DMA map\n"); + if_printf(ifp, "could not create rx DMA tag\n"); return error; } @@ -2292,16 +2281,14 @@ mwl_rxdma_setup(struct mwl_softc *sc) static void mwl_rxdma_cleanup(struct mwl_softc *sc) { - if (sc->sc_rxmap != NULL) + if (sc->sc_rxmem_paddr != 0) { bus_dmamap_unload(sc->sc_rxdmat, sc->sc_rxmap); + sc->sc_rxmem_paddr = 0; + } if (sc->sc_rxmem != NULL) { bus_dmamem_free(sc->sc_rxdmat, sc->sc_rxmem, sc->sc_rxmap); sc->sc_rxmem = NULL; } - if (sc->sc_rxmap != NULL) { - bus_dmamap_destroy(sc->sc_rxdmat, sc->sc_rxmap); - sc->sc_rxmap = NULL; - } if (sc->sc_rxdma.dd_bufptr != NULL) { free(sc->sc_rxdma.dd_bufptr, M_MWLDEV); sc->sc_rxdma.dd_bufptr = NULL; diff --git a/sys/dev/mwl/mwlhal.c b/sys/dev/mwl/mwlhal.c index 4547fe5..092f5f8 100644 --- a/sys/dev/mwl/mwlhal.c +++ b/sys/dev/mwl/mwlhal.c @@ -309,19 +309,12 @@ mwl_hal_attach(device_t dev, uint16_t devid, NULL, /* lockarg */ &mh->mh_dmat); if (error != 0) { - device_printf(dev, "unable to allocate memory for cmd buffer, " + device_printf(dev, "unable to allocate memory for cmd tag, " "error %u\n", error); goto fail0; } /* allocate descriptors */ - error = bus_dmamap_create(mh->mh_dmat, BUS_DMA_NOWAIT, &mh->mh_dmamap); - if (error != 0) { - device_printf(dev, "unable to create dmamap for cmd buffers, " - "error %u\n", error); - goto fail0; - } - error = bus_dmamem_alloc(mh->mh_dmat, (void**) &mh->mh_cmdbuf, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mh->mh_dmamap); @@ -365,9 +358,8 @@ mwl_hal_attach(device_t dev, uint16_t devid, fail2: bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); fail1: - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); -fail0: bus_dma_tag_destroy(mh->mh_dmat); +fail0: mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); return NULL; @@ -379,7 +371,6 @@ mwl_hal_detach(struct mwl_hal *mh0) struct mwl_hal_priv *mh = MWLPRIV(mh0); bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); bus_dma_tag_destroy(mh->mh_dmat); mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index a3590ef..dc20040 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -1807,20 +1807,13 @@ safe_dma_malloc( goto fail_0; } - r = bus_dmamap_create(dma->dma_tag, BUS_DMA_NOWAIT, &dma->dma_map); - if (r != 0) { - device_printf(sc->sc_dev, "safe_dma_malloc: " - "bus_dmamap_create failed; error %u\n", r); - goto fail_1; - } - r = bus_dmamem_alloc(dma->dma_tag, (void**) &dma->dma_vaddr, BUS_DMA_NOWAIT, &dma->dma_map); if (r != 0) { device_printf(sc->sc_dev, "safe_dma_malloc: " "bus_dmammem_alloc failed; size %zu, error %u\n", size, r); - goto fail_2; + goto fail_1; } r = bus_dmamap_load(dma->dma_tag, dma->dma_map, dma->dma_vaddr, @@ -1831,21 +1824,18 @@ safe_dma_malloc( if (r != 0) { device_printf(sc->sc_dev, "safe_dma_malloc: " "bus_dmamap_load failed; error %u\n", r); - goto fail_3; + goto fail_2; } dma->dma_size = size; return (0); -fail_3: bus_dmamap_unload(dma->dma_tag, dma->dma_map); fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); fail_1: - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } @@ -1855,7 +1845,6 @@ safe_dma_free(struct safe_softc *sc, struct safe_dma_alloc *dma) { bus_dmamap_unload(dma->dma_tag, dma->dma_map); bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); } diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 75e770f..4dc5ca5 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -617,11 +617,8 @@ out_err: bus_dmamap_unload(mp->dmat, vbp->dmamap); if (vaddr) bus_dmamem_free(mp->dmat, vaddr, vbp->dmamap); - if (vbp) { - if (vbp->dmamap) - bus_dmamap_destroy(mp->dmat, vbp->dmamap); + if (vbp) __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB"); - } return 0; } @@ -639,7 +636,6 @@ static void ___dma_freep(m_pool_s *mp, m_addr_t m) *vbpp = (*vbpp)->next; bus_dmamap_unload(mp->dmat, vbp->dmamap); bus_dmamem_free(mp->dmat, (void *) vbp->vaddr, vbp->dmamap); - bus_dmamap_destroy(mp->dmat, vbp->dmamap); __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB"); --mp->nump; } diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 6032798..a5296f8 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -2944,12 +2944,11 @@ trm_destroySRB(PACB pACB) pSRB = pACB->pFreeSRB; while (pSRB) { - if (pSRB->sg_dmamap) { + if (pSRB->SRBSGPhyAddr) bus_dmamap_unload(pACB->sg_dmat, pSRB->sg_dmamap); + if (pSRB->pSRBSGL) bus_dmamem_free(pACB->sg_dmat, pSRB->pSRBSGL, pSRB->sg_dmamap); - bus_dmamap_destroy(pACB->sg_dmat, pSRB->sg_dmamap); - } if (pSRB->dmamap) bus_dmamap_destroy(pACB->buffer_dmat, pSRB->dmamap); pSRB = pSRB->pNextSRB; @@ -3494,7 +3493,6 @@ bad: bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); } if (pACB->sense_dmat) bus_dma_tag_destroy(pACB->sense_dmat); @@ -3502,11 +3500,10 @@ bad: trm_destroySRB(pACB); bus_dma_tag_destroy(pACB->sg_dmat); } - if (pACB->srb_dmamap) { + if (pACB->pFreeSRB) { bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); } if (pACB->srb_dmat) bus_dma_tag_destroy(pACB->srb_dmat); @@ -3618,19 +3615,17 @@ bad: bus_dma_tag_destroy(pACB->sg_dmat); } - if (pACB->srb_dmamap) { + if (pACB->pFreeSRB) { bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); } if (pACB->srb_dmat) bus_dma_tag_destroy(pACB->srb_dmat); - if (pACB->sense_dmamap) { + if (pACB->sense_buffers) { bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); } if (pACB->sense_dmat) bus_dma_tag_destroy(pACB->sense_dmat); @@ -3680,12 +3675,10 @@ trm_detach(device_t dev) bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); bus_dma_tag_destroy(pACB->srb_dmat); bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); bus_dma_tag_destroy(pACB->sense_dmat); bus_dma_tag_destroy(pACB->buffer_dmat); bus_teardown_intr(dev, pACB->irq, pACB->ih); diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index a150627..7a96558 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -447,17 +447,14 @@ epic_release(epic_softc_t *sc) if (sc->tx_flist) { bus_dmamap_unload(sc->ftag, sc->fmap); bus_dmamem_free(sc->ftag, sc->tx_flist, sc->fmap); - bus_dmamap_destroy(sc->ftag, sc->fmap); } if (sc->tx_desc) { bus_dmamap_unload(sc->ttag, sc->tmap); bus_dmamem_free(sc->ttag, sc->tx_desc, sc->tmap); - bus_dmamap_destroy(sc->ttag, sc->tmap); } if (sc->rx_desc) { bus_dmamap_unload(sc->rtag, sc->rmap); bus_dmamem_free(sc->rtag, sc->rx_desc, sc->rmap); - bus_dmamap_destroy(sc->rtag, sc->rmap); } if (sc->mtag) bus_dma_tag_destroy(sc->mtag); diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index 6c06b71..956feac 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -1856,13 +1856,6 @@ ubsec_dma_malloc( if (r != 0) { device_printf(sc->sc_dev, "ubsec_dma_malloc: " "bus_dma_tag_create failed; error %u\n", r); - goto fail_0; - } - - r = bus_dmamap_create(dma->dma_tag, BUS_DMA_NOWAIT, &dma->dma_map); - if (r != 0) { - device_printf(sc->sc_dev, "ubsec_dma_malloc: " - "bus_dmamap_create failed; error %u\n", r); goto fail_1; } @@ -1894,10 +1887,7 @@ fail_3: fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); fail_1: - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); -fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } @@ -1907,7 +1897,6 @@ ubsec_dma_free(struct ubsec_softc *sc, struct ubsec_dma_alloc *dma) { bus_dmamap_unload(dma->dma_tag, dma->dma_map); bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); } |