mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: kvm-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, mingo@elte.hu
Subject: [PATCH 1/5] KVM: Use more traditional error handling in kvm_mmu_init()
Date: Thu, 21 Dec 2006 09:46:04 -0000	[thread overview]
Message-ID: <20061221094604.AE498250048@il.qumranet.com> (raw)
In-Reply-To: <458A57A4.9000807@qumranet.com>

Signed-off-by: Avi Kivity <avi@qumranet.com>

Index: linux-2.6/drivers/kvm/mmu.c
===================================================================
--- linux-2.6.orig/drivers/kvm/mmu.c
+++ linux-2.6/drivers/kvm/mmu.c
@@ -647,14 +647,20 @@ int kvm_mmu_init(struct kvm_vcpu *vcpu)
 	ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa));
 	ASSERT(list_empty(&vcpu->free_pages));
 
-	if ((r = alloc_mmu_pages(vcpu)))
-		return r;
+	r = alloc_mmu_pages(vcpu);
+	if (r)
+		goto out;
+
+	r = init_kvm_mmu(vcpu);
+	if (r)
+		goto out_free_pages;
 
-	if ((r = init_kvm_mmu(vcpu))) {
-		free_mmu_pages(vcpu);
-		return r;
-	}
 	return 0;
+
+out_free_pages:
+	free_mmu_pages(vcpu);
+out:
+	return r;
 }
 
 void kvm_mmu_destroy(struct kvm_vcpu *vcpu)

  reply	other threads:[~2006-12-21  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21  9:45 [PATCH 0/5] KVM: Updates Avi Kivity
2006-12-21  9:46 ` Avi Kivity [this message]
2006-12-21  9:47 ` [PATCH 2/5] KVM: Do not export unsupported msrs to userspace Avi Kivity
2006-12-21  9:48 ` [PATCH 3/5] KVM: Force real-mode cs limit to 64K Avi Kivity
2006-12-21  9:49 ` [PATCH 4/5] KVM: Handle p5 mce msrs Avi Kivity
2006-12-21  9:50 ` [PATCH 5/5] KVM: API versioning Avi Kivity
2006-12-28 12:32 ` [patch] kvm: fix GFP_KERNEL alloc in atomic section bug Ingo Molnar
2006-12-28 12:44   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061221094604.AE498250048@il.qumranet.com \
    --to=avi@qumranet.com \
    --cc=akpm@osdl.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®