ARM64: dma-mapping: zero the buffer that allocate with __GFP_ZERO flags

This commit is contained in:
CMY
2015-02-14 16:03:06 +08:00
parent abc2159654
commit fca343c4d5

View File

@@ -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);