Avoid a NULL pointer dereference in bounce_bus_dmamap_sync() when the
map has been created via bounce_bus_dmamem_alloc(). Even for coherent DMA - which bus_dmamem_alloc(9) typically is used for -, calling of bus_dmamap_sync(9) isn't optional. PR: 188899 (non-original problem) MFC after: 3 days
This commit is contained in:
parent
beef81f726
commit
ac288bbb4a
@ -767,7 +767,7 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct bounce_page *bpage;
|
||||
vm_offset_t datavaddr, tempvaddr;
|
||||
|
||||
if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL)
|
||||
if (map == NULL || (bpage = STAILQ_FIRST(&map->bpages)) == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
@ -892,7 +892,7 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
vm_offset_t datavaddr, tempvaddr;
|
||||
bus_size_t datacount1, datacount2;
|
||||
|
||||
if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL)
|
||||
if (map == NULL || (bpage = STAILQ_FIRST(&map->bpages)) == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user