summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorRusty Russell2007-08-01 06:46:11 +0200
committerAvi Kivity2007-10-13 10:18:23 +0200
commita477034750ce59df7fc17823f085df5a30e316f0 (patch)
treecfca29ba12e9bcb7256ff424438020545721e305 /drivers/kvm/svm.c
parentKVM: Add and use pr_unimpl for standard formatting of unimplemented features (diff)
downloadkernel-qcow2-linux-a477034750ce59df7fc17823f085df5a30e316f0.tar.gz
kernel-qcow2-linux-a477034750ce59df7fc17823f085df5a30e316f0.tar.xz
kernel-qcow2-linux-a477034750ce59df7fc17823f085df5a30e316f0.zip
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.c4
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)
uninit:
kvm_vcpu_uninit(&svm->vcpu);
free_svm:
- kfree(svm);
+ kmem_cache_free(kvm_vcpu_cache, svm);
out:
return ERR_PTR(err);
}
@@ -621,7 +621,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu)
__free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT));
kvm_vcpu_uninit(vcpu);
- kfree(svm);
+ kmem_cache_free(kvm_vcpu_cache, svm);
}
static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)