diff options
Diffstat (limited to 'sys/dev/safe/safe.c')
-rw-r--r-- | sys/dev/safe/safe.c | 15 |
1 files changed, 2 insertions, 13 deletions
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); } |