aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2008-11-26 08:51:08 -0500
committerAvi Kivity <avi@redhat.com>2008-12-31 09:55:03 -0500
commit6692cef30b7caf7525ae99670cddbaf28f1f9d40 (patch)
tree956c25e52ef23e7127bef18b8b53d82e5e62220d /arch/s390/kvm
parentd329c035e754156ffabcb64ff75d05bb8e2ddbf5 (diff)
KVM: s390: Fix memory leak of vcpu->run
The s390 backend of kvm never calls kvm_vcpu_uninit. This causes a memory leak of vcpu->run pages. Lets call kvm_vcpu_uninit in kvm_arch_vcpu_destroy to free the vcpu->run. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 3db9e5d45a67..76f05ddaef10 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -198,6 +198,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
198{ 198{
199 VCPU_EVENT(vcpu, 3, "%s", "free cpu"); 199 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
200 free_page((unsigned long)(vcpu->arch.sie_block)); 200 free_page((unsigned long)(vcpu->arch.sie_block));
201 kvm_vcpu_uninit(vcpu);
201 kfree(vcpu); 202 kfree(vcpu);
202} 203}
203 204
@@ -230,8 +231,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
230 231
231void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) 232void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
232{ 233{
233 /* kvm common code refers to this, but does'nt call it */ 234 /* Nothing todo */
234 BUG();
235} 235}
236 236
237void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 237void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)