diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2010-03-09 01:37:53 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:15:19 -0400 |
commit | 7b06bf2ffa15e119c7439ed0b024d44f66d7b605 (patch) | |
tree | 8572708678cb7ee3d541bca927581f5ce7f59cba /arch | |
parent | 835e6b80478e59820cff127adba3e518ae5a43f5 (diff) |
KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()
This patch fixed possible memory leak in kvm_arch_vcpu_create()
under s390, which would happen when kvm_arch_vcpu_create() fails.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 49292869a5cd..ee7c713686ce 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -341,11 +341,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, | |||
341 | 341 | ||
342 | rc = kvm_vcpu_init(vcpu, kvm, id); | 342 | rc = kvm_vcpu_init(vcpu, kvm, id); |
343 | if (rc) | 343 | if (rc) |
344 | goto out_free_cpu; | 344 | goto out_free_sie_block; |
345 | VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu, | 345 | VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu, |
346 | vcpu->arch.sie_block); | 346 | vcpu->arch.sie_block); |
347 | 347 | ||
348 | return vcpu; | 348 | return vcpu; |
349 | out_free_sie_block: | ||
350 | free_page((unsigned long)(vcpu->arch.sie_block)); | ||
349 | out_free_cpu: | 351 | out_free_cpu: |
350 | kfree(vcpu); | 352 | kfree(vcpu); |
351 | out_nomem: | 353 | out_nomem: |