diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2014-06-13 18:20:44 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2014-06-13 18:20:44 +0000 |
| commit | aced5239b239beb4bd419a8dafbde08f809b8585 (patch) | |
| tree | 0a0f66cb6a86ef083ff47fdb6de973aaea4d9049 /sys/dev/mlx | |
| parent | b30283c0916ef1c0a5b1dd411cfc4c39bcc1384f (diff) | |
Notes
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 ddcf4b0598bc..0f92eaf35385 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 |
