diff mbox

kvm: minor change in kvm_iommu_put_pages

Message ID alpine.DEB.2.02.1210252112420.31588@domU-12-31-39-16-BE-CA.compute-1.internal (mailing list archive)
State New, archived
Headers show

Commit Message

Fred R. Oxhey Nov. 7, 2012, 2:39 a.m. UTC
Moving the test right after domain is assigned.


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


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

Patch

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;