diff options
author | Joerg Roedel <jroedel@suse.de> | 2019-04-11 17:15:35 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2019-04-11 17:15:35 +0200 |
commit | 2b899390fdc8b8bdb95ce24269a799194b303388 (patch) | |
tree | ee02a7ae5b0f94029c5594573ae4aa97944a2c0c /drivers/iommu/iova.c | |
parent | 5aba6c47401d14247a44c3ae94d1bdab5653f692 (diff) | |
parent | 26b25a2b98e45aeb40eedcedc586ad5034cbd984 (diff) | |
download | linux-2b899390fdc8b8bdb95ce24269a799194b303388.tar.bz2 |
Merge branch 'api-features' into x86/vt-d
Diffstat (limited to 'drivers/iommu/iova.c')
-rw-r--r-- | drivers/iommu/iova.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index f8d3ba247523..2de8122e218f 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -207,8 +207,10 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, curr_iova = rb_entry(curr, struct iova, node); } while (curr && new_pfn <= curr_iova->pfn_hi); - if (limit_pfn < size || new_pfn < iovad->start_pfn) + if (limit_pfn < size || new_pfn < iovad->start_pfn) { + iovad->max32_alloc_size = size; goto iova32_full; + } /* pfn_lo will point to size aligned address if size_aligned is set */ new->pfn_lo = new_pfn; @@ -222,7 +224,6 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, return 0; iova32_full: - iovad->max32_alloc_size = size; spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); return -ENOMEM; } |