aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/kvm/svm.c4
-rw-r--r--drivers/kvm/vmx.c4
2 files changed, 4 insertions, 4 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)
610uninit: 610uninit:
611 kvm_vcpu_uninit(&svm->vcpu); 611 kvm_vcpu_uninit(&svm->vcpu);
612free_svm: 612free_svm:
613 kfree(svm); 613 kmem_cache_free(kvm_vcpu_cache, svm);
614out: 614out:
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
627static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 627static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
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
2365static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) 2365static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
@@ -2410,7 +2410,7 @@ free_guest_msrs:
2410uninit_vcpu: 2410uninit_vcpu:
2411 kvm_vcpu_uninit(&vmx->vcpu); 2411 kvm_vcpu_uninit(&vmx->vcpu);
2412free_vcpu: 2412free_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