if_iwm - Fix iwm_dma_contig_free(). dma->map is always NULL here.
commitef2b29a7ba6ca8a9d2c82ab591c0622227ff84cb
authorImre Vadász <imre@vdsz.com>
Fri, 10 Jun 2016 00:04:31 +0000 (10 02:04 +0200)
committerImre Vadász <imre@vdsz.com>
Fri, 10 Jun 2016 00:31:32 +0000 (10 02:31 +0200)
tree9a1bb9de760a85ef47794d67682c04b088af7d4e
parent5f59596d186cd7f9ff48a747e8dd29cca1286e72
if_iwm - Fix iwm_dma_contig_free(). dma->map is always NULL here.

* When bus_dmamem_alloc is used, the bus_dmamap_t is set to NULL, so we
  were never actually freeing any dma memory allocations done via
  iwm_dma_contig_alloc(). So we should check dma->vaddr instead of
  dma->map here.

* This reduces dma memory leakage (as displayed by
  "sysctl vm.dma_free_pages") to 11 pages for each if_iwm module
  load/unload cycle.
sys/dev/netif/iwm/if_iwm.c