mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
Memory allocated with contigmalloc() should be freed with
contigfree(), not with free().
This commit is contained in:
parent
53bd74b7e9
commit
ea458bbcdb
1 changed files with 4 additions and 1 deletions
|
|
@ -377,7 +377,10 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
|
|||
*/
|
||||
if (map != &nobounce_dmamap)
|
||||
panic("bus_dmamem_free: Invalid map freed\n");
|
||||
free(vaddr, M_DEVBUF);
|
||||
if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem))
|
||||
free(vaddr, M_DEVBUF);
|
||||
else
|
||||
contigfree(vaddr, dmat->maxsize, M_DEVBUF);
|
||||
}
|
||||
|
||||
#define BUS_DMAMAP_NSEGS ((64 * 1024 / PAGE_SIZE) + 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue