Skip to content

Commit

Permalink
[PATCH] KVM: Use more traditional error handling in kvm_mmu_init()
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Avi Kivity authored and Linus Torvalds committed Dec 22, 2006
1 parent 36241b8 commit 2c26495
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions drivers/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2c26495

Please sign in to comment.