diff options
author | jhb <jhb@FreeBSD.org> | 2014-06-13 18:20:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-06-13 18:20:44 +0000 |
commit | 4b2862afcf79ea4b962966fb574c207179b02a32 (patch) | |
tree | 0a0f66cb6a86ef083ff47fdb6de973aaea4d9049 /sys/dev/mlx | |
parent | 538796da605ba2e36b056ca95d2a35bfed1bf89a (diff) | |
download | FreeBSD-src-4b2862afcf79ea4b962966fb574c207179b02a32.zip FreeBSD-src-4b2862afcf79ea4b962966fb574c207179b02a32.tar.gz |
Add missing calls to bus_dmamap_unload() when freeing static DMA
allocations.
Reviewed by: scottl
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r-- | sys/dev/mlx/mlx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index ddcf4b0..0f92eaf 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -191,6 +191,8 @@ mlx_free(struct mlx_softc *sc) bus_dma_tag_destroy(sc->mlx_buffer_dmat); /* free and destroy DMA memory and tag for s/g lists */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) @@ -239,10 +241,15 @@ mlx_sglist_map(struct mlx_softc *sc) debug_called(1); /* destroy any existing mappings */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) bus_dma_tag_destroy(sc->mlx_sg_dmat); + sc->mlx_sgbusaddr = 0; + sc->mlx_sgtable = NULL; + sc->mlx_sg_dmat = NULL; /* * Create a single tag describing a region large enough to hold all of |