public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks
@ 2010-01-22  6:18 Wei Yongjun
  2010-01-22  6:21 ` [PATCH 2/2] KVM: x86: Fix leak of free lapic date in kvm_arch_vcpu_init() Wei Yongjun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wei Yongjun @ 2010-01-22  6:18 UTC (permalink / raw)
  To: kvm, Avi Kivity

vcpu->arch.mce_banks is malloc in kvm_arch_vcpu_init(), but
never free in any place, this may cause memory leak. So this
patch fixed to free it in kvm_arch_vcpu_uninit().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 arch/x86/kvm/x86.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f25b52e..1ddcad4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5089,6 +5089,7 @@ fail:
 
 void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
 {
+	kfree(vcpu->arch.mce_banks);
 	kvm_free_lapic(vcpu);
 	down_read(&vcpu->kvm->slots_lock);
 	kvm_mmu_destroy(vcpu);
-- 
1.6.2.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-23 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-22  6:18 [PATCH 1/2] KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks Wei Yongjun
2010-01-22  6:21 ` [PATCH 2/2] KVM: x86: Fix leak of free lapic date in kvm_arch_vcpu_init() Wei Yongjun
2010-01-22  6:41 ` [PATCH 1/2 v2] KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks Wei Yongjun
2010-01-22  8:55 ` [PATCH] KVM: MMU: Remove some useless code from alloc_mmu_pages() Wei Yongjun
2010-01-23 19:23   ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox