mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
ARM64: dma-mapping: zero the buffer that allocate with __GFP_ZERO flags
This commit is contained in:
@@ -158,6 +158,9 @@ static void *__dma_alloc_noncoherent(struct device *dev, size_t size,
|
||||
if (!ptr)
|
||||
goto no_mem;
|
||||
|
||||
if (flags & __GFP_ZERO)
|
||||
memset(ptr, 0, size);
|
||||
|
||||
/* remove any dirty cache lines on the kernel alias */
|
||||
__dma_flush_range(ptr, ptr + size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user