Memory allocated with contigmalloc() should be freed with

contigfree(), not with free().
This commit is contained in:
Maxime Henrion 2003-03-13 17:10:54 +00:00
parent 53bd74b7e9
commit ea458bbcdb

View File

@ -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)