summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-06-13 19:40:02 +0000
committerjhb <jhb@FreeBSD.org>2014-06-13 19:40:02 +0000
commit0588aeff7ccf64c865aa85d2201f8593b1ab9f43 (patch)
tree3a301ad1ba1139df7cd696afd20116d81bfa0b81 /sys
parent51e6965b32c38db8e7e56facf0be5cbad2b44d1f (diff)
downloadFreeBSD-src-0588aeff7ccf64c865aa85d2201f8593b1ab9f43.zip
FreeBSD-src-0588aeff7ccf64c865aa85d2201f8593b1ab9f43.tar.gz
- Don't check the dma map address for a static DMA mapping against NULL
to determine if the mapping is valid. - Don't explicitly destroy the dmap map for static DMA mappings. Reviewed by: adrian
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/iwn/if_iwn.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index cba8d0d..c45d231 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -1733,16 +1733,12 @@ fail: iwn_dma_contig_free(dma);
static void
iwn_dma_contig_free(struct iwn_dma_info *dma)
{
- if (dma->map != NULL) {
- if (dma->vaddr != NULL) {
- bus_dmamap_sync(dma->tag, dma->map,
- BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
- bus_dmamap_unload(dma->tag, dma->map);
- bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
- dma->vaddr = NULL;
- }
- bus_dmamap_destroy(dma->tag, dma->map);
- dma->map = NULL;
+ if (dma->vaddr != NULL) {
+ bus_dmamap_sync(dma->tag, dma->map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(dma->tag, dma->map);
+ bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
+ dma->vaddr = NULL;
}
if (dma->tag != NULL) {
bus_dma_tag_destroy(dma->tag);
OpenPOWER on IntegriCloud