]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix various bugs with freeing static DMA allocations in sound drivers:
authorjhb <jhb@FreeBSD.org>
Tue, 17 Jun 2014 16:07:57 +0000 (16:07 +0000)
committerjhb <jhb@FreeBSD.org>
Tue, 17 Jun 2014 16:07:57 +0000 (16:07 +0000)
commit46e105f75300bd61be696326649e4e03a6f59855
tree032ffa17eaf7029172610e6cecfac65d5d65eb25
parentc2c10fcea6f7f1fe8e8dc140b4e58917fe2967e6
Fix various bugs with freeing static DMA allocations in sound drivers:
- Don't compare the DMA map to NULL to determine if bus_dmamap_unload()
  should be called when releasing a static allocation.  Instead, compare
  the bus address against 0.
- Don't assume that the DMA map for static allocations is NULL.  Instead,
  save the value set by bus_dmamem_alloc() so it can later be passed to
  bus_dmamem_free().  Also, add missing calls to bus_dmamap_unload() in
  these cases before freeing the buffer.
- Use the bus address from the bus_dma callback instead of calling
  vtophys() on the address allocated by bus_dmamem_alloc().

Reviewed by: kan
sys/dev/sound/pci/atiixp.c
sys/dev/sound/pci/emu10k1.c
sys/dev/sound/pci/emu10kx.c
sys/dev/sound/pci/envy24.c
sys/dev/sound/pci/envy24ht.c
sys/dev/sound/pci/hda/hdac.c
sys/dev/sound/pci/hdspe.c
sys/dev/sound/pci/maestro.c
sys/dev/sound/pci/via8233.c
sys/dev/sound/pci/via82c686.c
sys/dev/sound/pcm/buffer.c