arm64: Check if we have a map before checking the flags

This fixes amdgpu on arm64 where linuxkpi is calling id_mapped
and we call might_bounce without a map.
This commit is contained in:
Emmanuel Vadot 2020-11-24 14:05:35 +00:00
parent caf4397197
commit 219f1919ab

View File

@ -207,7 +207,7 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
{
/* Memory allocated by bounce_bus_dmamem_alloc won't bounce */
if ((map->flags & DMAMAP_FROM_DMAMEM) != 0)
if (map && (map->flags & DMAMAP_FROM_DMAMEM) != 0)
return (false);
if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0)