arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 12 Jun 2018 11:08:40 +0000 (13:08 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 19 Jun 2018 13:19:21 +0000 (14:19 +0100)
commitdd65a941f6ba473a5cb9d013d57fa43b48450a04
tree3239077195d29ca00d83dffe4d3097128444055e
parentce397d215ccd07b8ae3f71db689aedb85d56ab40
arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag

dma_alloc_*() buffers might be exposed to userspace via mmap() call, so
they should be cleared on allocation. In case of IOMMU-based dma-mapping
implementation such buffer clearing was missing in the code path for
DMA_ATTR_FORCE_CONTIGUOUS flag handling, because dma_alloc_from_contiguous()
doesn't honor __GFP_ZERO flag. This patch fixes this issue. For more
information on clearing buffers allocated by dma_alloc_* functions,
see commit 6829e274a623 ("arm64: dma-mapping: always clear allocated
buffers").

Fixes: 44176bb38fa4 ("arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/dma-mapping.c