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/vmx.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/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ae54d9a24ce8..708055a50521 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -2359,7 +2359,7 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu) | |||
2359 | kfree(vmx->host_msrs); | 2359 | kfree(vmx->host_msrs); |
2360 | kfree(vmx->guest_msrs); | 2360 | kfree(vmx->guest_msrs); |
2361 | kvm_vcpu_uninit(vcpu); | 2361 | kvm_vcpu_uninit(vcpu); |
2362 | kfree(vmx); | 2362 | kmem_cache_free(kvm_vcpu_cache, vmx); |
2363 | } | 2363 | } |
2364 | 2364 | ||
2365 | static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) | 2365 | static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) |
@@ -2410,7 +2410,7 @@ free_guest_msrs: | |||
2410 | uninit_vcpu: | 2410 | uninit_vcpu: |
2411 | kvm_vcpu_uninit(&vmx->vcpu); | 2411 | kvm_vcpu_uninit(&vmx->vcpu); |
2412 | free_vcpu: | 2412 | free_vcpu: |
2413 | kfree(vmx); | 2413 | kmem_cache_free(kvm_vcpu_cache, vmx); |
2414 | return ERR_PTR(err); | 2414 | return ERR_PTR(err); |
2415 | } | 2415 | } |
2416 | 2416 | ||