diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 4959f5df21bd07..31e4e305d8d592 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -24,6 +24,7 @@ #include #include #include +#include struct iommu_dma_msi_page { struct list_head list; @@ -549,8 +550,15 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev, if (!PageCompound(page)) { split_page(page, order); break; - } else if (!split_huge_page(page)) { - break; + } else { + int err; + + lock_page(page); + err = split_huge_page(page); + unlock_page(page); + + if (!err) + break; } __free_pages(page, order); }