mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocated
by bus_dmamem_alloc() which creates associated bus_dmamap_t map for us. When this memory is freed by bus_dmamem_free(), the map is freed as well. Thus there is no need to free it explicitly by bus_dmamap_destroy(), which leads to double freeing. Discussed with: gonzo Approved by: kib (mentor)
This commit is contained in:
parent
ea228b482e
commit
72683266d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290553
|
@ -542,9 +542,8 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
|
|||
return 0;
|
||||
|
||||
failed_load:
|
||||
bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map);
|
||||
bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map);
|
||||
failed_alloc:
|
||||
bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map);
|
||||
bus_dma_tag_destroy(bi->pagelist_dma_tag);
|
||||
|
||||
return err;
|
||||
|
@ -613,7 +612,6 @@ free_pagelist(BULKINFO_T *bi, int actual)
|
|||
|
||||
bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map);
|
||||
bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map);
|
||||
bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map);
|
||||
bus_dma_tag_destroy(bi->pagelist_dma_tag);
|
||||
|
||||
free(bi, M_VCPAGELIST);
|
||||
|
|
Loading…
Reference in a new issue