diff options
Diffstat (limited to 'drivers/iommu/dma-iommu.c')
-rw-r--r-- | drivers/iommu/dma-iommu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index d991d40f797f..f68a62c3c32b 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c | |||
@@ -965,11 +965,14 @@ static void *iommu_dma_alloc_pages(struct device *dev, size_t size, | |||
965 | { | 965 | { |
966 | bool coherent = dev_is_dma_coherent(dev); | 966 | bool coherent = dev_is_dma_coherent(dev); |
967 | size_t alloc_size = PAGE_ALIGN(size); | 967 | size_t alloc_size = PAGE_ALIGN(size); |
968 | int node = dev_to_node(dev); | ||
968 | struct page *page = NULL; | 969 | struct page *page = NULL; |
969 | void *cpu_addr; | 970 | void *cpu_addr; |
970 | 971 | ||
971 | page = dma_alloc_contiguous(dev, alloc_size, gfp); | 972 | page = dma_alloc_contiguous(dev, alloc_size, gfp); |
972 | if (!page) | 973 | if (!page) |
974 | page = alloc_pages_node(node, gfp, get_order(alloc_size)); | ||
975 | if (!page) | ||
973 | return NULL; | 976 | return NULL; |
974 | 977 | ||
975 | if (IS_ENABLED(CONFIG_DMA_REMAP) && (!coherent || PageHighMem(page))) { | 978 | if (IS_ENABLED(CONFIG_DMA_REMAP) && (!coherent || PageHighMem(page))) { |