[PATCH] kvm: minor change in kvm_iommu_put_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Moving the test right after domain is assigned.


Signed-off-by: Fred R. Oxhey <fr@xxxxxxxxxxxxx>
---
 virt/kvm/iommu.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index e9fff98..8d2e1dc 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -287,13 +287,13 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
 	u64 phys;

 	domain  = kvm->arch.iommu_domain;
-	end_gfn = base_gfn + npages;
-	gfn     = base_gfn;
-
 	/* check if iommu exists and in use */
 	if (!domain)
 		return;

+	end_gfn = base_gfn + npages;
+	gfn     = base_gfn;
+
 	while (gfn < end_gfn) {
 		unsigned long unmap_pages;
 		size_t size;

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux