From f047773516dd65435becf09d8d03e5ef2a9f4165 Mon Sep 17 00:00:00 2001 From: Waqar Hameed Date: Mon, 4 Oct 2021 17:05:48 +0200 Subject: [PATCH] Fix DMA address truncation in gasket_coherent_buffer `ulong` may not be sufficiently wide for addresses returned by the DMA API. For example, a 32-bit platform can still have DMA addresses larger than 32-bit. By using the correct type `dma_addr_t` we fix this truncation. Change-Id: Ibdf6456fdf12d889296e580de2acb910527ce0aa Signed-off-by: Waqar Hameed --- src/gasket_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gasket_core.h b/src/gasket_core.h index 7405b6a..d81ec9b 100644 --- a/src/gasket_core.h +++ b/src/gasket_core.h @@ -228,7 +228,7 @@ struct gasket_coherent_buffer { u8 __iomem *virt_base; /* Physical base address. */ - ulong phys_base; + dma_addr_t phys_base; /* Length of the mapping. */ ulong length_bytes;