aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/iommu.c')
-rw-r--r--virt/kvm/iommu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index c03f1fb26701..6a67bea4019c 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -107,6 +107,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
107 */ 107 */
108 pfn = kvm_pin_pages(slot, gfn, page_size); 108 pfn = kvm_pin_pages(slot, gfn, page_size);
109 if (is_error_pfn(pfn)) { 109 if (is_error_pfn(pfn)) {
110 kvm_release_pfn_clean(pfn);
110 gfn += 1; 111 gfn += 1;
111 continue; 112 continue;
112 } 113 }
@@ -300,6 +301,12 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
300 301
301 /* Get physical address */ 302 /* Get physical address */
302 phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn)); 303 phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn));
304
305 if (!phys) {
306 gfn++;
307 continue;
308 }
309
303 pfn = phys >> PAGE_SHIFT; 310 pfn = phys >> PAGE_SHIFT;
304 311
305 /* Unmap address from IO address space */ 312 /* Unmap address from IO address space */