mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Restore the check for non-NULL dmatag in sndbuf_free.
The sound drivers that use own buffer management can use sndbuf_setup and not do any busdma allocation, so the driver will end up with the managed buffer but no valid dma map and tag for it. Avoid calling bus_dmamem_free in such cases. Reported by: ache Missed in review by: kan
This commit is contained in:
parent
efa1aff675
commit
8cf27a3330
1 changed files with 2 additions and 1 deletions
|
|
@ -141,7 +141,8 @@ sndbuf_free(struct snd_dbuf *b)
|
|||
if (b->flags & SNDBUF_F_MANAGED) {
|
||||
if (b->buf_addr)
|
||||
bus_dmamap_unload(b->dmatag, b->dmamap);
|
||||
bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
|
||||
if (b->dmatag)
|
||||
bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
|
||||
} else
|
||||
free(b->buf, M_DEVBUF);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue