KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()
PATCH 1/1 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 <[email protected]>
--- arch/s390/kvm/kvm-s390.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/s390/kvm/kvm-s390.c +3 -1
@@ -340,11 +340,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, rc =kvm_vcpu_init (vcpu, kvm, id);if (rc) - goto out_free_cpu; + goto out_free_sie_block;VM_EVENT (kvm,3 ,"create cpu %d at %p, sie block at %p" , id, vcpu, vcpu->arch.sie_block);return vcpu; +out_free_sie_block: +free_page ((unsigned long )(vcpu->arch.sie_block)); out_free_cpu:kfree (vcpu); out_nomem:
Signature · 1 line
1.6.3.3
Quoted 2 lines · Wei Yongjun
This patch fixed possible memory leak in
kvm_arch_vcpu_create()under s390, which would happen whenkvm_arch_vcpu_create()fails.
Good catch, thanks!
Acked-by Carsten Otte <[email protected]>
Avi Kivity
AppliedQuoted 3 lines · Wei Yongjun
This patch fixed possible memory leak in
kvm_arch_vcpu_create()under s390, which would happen whenkvm_arch_vcpu_create()fails.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function