Re: [PATCH] KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()

2010-03-09 Thread Avi Kivity
On 03/09/2010 08:37 AM, Wei Yongjun wrote:
 This patch fixed possible memory leak in kvm_arch_vcpu_create()
 under s390, which would happen when kvm_arch_vcpu_create() fails.
   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()

2010-03-09 Thread Carsten Otte

Wei Yongjun wrote:

This patch fixed possible memory leak in kvm_arch_vcpu_create()
under s390, which would happen when kvm_arch_vcpu_create() fails.

Good catch, thanks!

Acked-by: Carsten Otte co...@de.ibm.com
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()

2010-03-08 Thread Wei Yongjun
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 yj...@cn.fujitsu.com
---
 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 8f09959..f07d65f 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -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:
-- 
1.6.3.3


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html