Memory allocated with contigmalloc() should be freed with
contigfree(), not with free().
This commit is contained in:
parent
53bd74b7e9
commit
ea458bbcdb
@ -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 New Issue
Block a user