Commit 2c264957 authored by Avi Kivity's avatar Avi Kivity Committed by Linus Torvalds

[PATCH] KVM: Use more traditional error handling in kvm_mmu_init()

Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 36241b8c
...@@ -647,14 +647,20 @@ int kvm_mmu_init(struct kvm_vcpu *vcpu) ...@@ -647,14 +647,20 @@ int kvm_mmu_init(struct kvm_vcpu *vcpu)
ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa));
ASSERT(list_empty(&vcpu->free_pages)); ASSERT(list_empty(&vcpu->free_pages));
if ((r = alloc_mmu_pages(vcpu))) r = alloc_mmu_pages(vcpu);
return r; if (r)
goto out;
r = init_kvm_mmu(vcpu);
if (r)
goto out_free_pages;
return 0;
if ((r = init_kvm_mmu(vcpu))) { out_free_pages:
free_mmu_pages(vcpu); free_mmu_pages(vcpu);
out:
return r; return r;
}
return 0;
} }
void kvm_mmu_destroy(struct kvm_vcpu *vcpu) void kvm_mmu_destroy(struct kvm_vcpu *vcpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment