diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-08-01 00:46:11 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:23 -0400 |
commit | a477034750ce59df7fc17823f085df5a30e316f0 (patch) | |
tree | cfca29ba12e9bcb7256ff424438020545721e305 /drivers/kvm/svm.c | |
parent | f02424785ab83bab8283ad33044284f749c08db8 (diff) |
KVM: Use kmem_cache_free for kmem_cache_zalloc'ed objects
We use kfree in svm.c and vmx.c, and this works, but it could break at
any time. kfree() is supposed to match up with kmalloc().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 3ec30d7c9b93..436bdff9b0bf 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -610,7 +610,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
610 | uninit: | 610 | uninit: |
611 | kvm_vcpu_uninit(&svm->vcpu); | 611 | kvm_vcpu_uninit(&svm->vcpu); |
612 | free_svm: | 612 | free_svm: |
613 | kfree(svm); | 613 | kmem_cache_free(kvm_vcpu_cache, svm); |
614 | out: | 614 | out: |
615 | return ERR_PTR(err); | 615 | return ERR_PTR(err); |
616 | } | 616 | } |
@@ -621,7 +621,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu) | |||
621 | 621 | ||
622 | __free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT)); | 622 | __free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT)); |
623 | kvm_vcpu_uninit(vcpu); | 623 | kvm_vcpu_uninit(vcpu); |
624 | kfree(svm); | 624 | kmem_cache_free(kvm_vcpu_cache, svm); |
625 | } | 625 | } |
626 | 626 | ||
627 | static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | 627 | static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) |