__builtin_return_address(0));
if (!ret)
goto out_free_pages;
- if (dma_set_decrypted(dev, ret, size))
- goto out_free_pages;
memset(ret, 0, size);
goto done;
}
dma_free_from_pool(dev, cpu_addr, PAGE_ALIGN(size)))
return;
- dma_set_encrypted(dev, cpu_addr, 1 << page_order);
-
- if (IS_ENABLED(CONFIG_DMA_REMAP) && is_vmalloc_addr(cpu_addr))
+ if (IS_ENABLED(CONFIG_DMA_REMAP) && is_vmalloc_addr(cpu_addr)) {
vunmap(cpu_addr);
- else if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_CLEAR_UNCACHED))
- arch_dma_clear_uncached(cpu_addr, size);
+ } else {
+ if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_CLEAR_UNCACHED))
+ arch_dma_clear_uncached(cpu_addr, size);
+ dma_set_encrypted(dev, cpu_addr, 1 << page_order);
+ }
__dma_direct_free_pages(dev, dma_direct_to_page(dev, dma_addr), size);
}