summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-01-22 07:18:47 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2010-01-25 15:26:40 +0100
commit36cb93fd6b6bf7e9163a69a8bf20207aed5fea44 (patch)
treeec12f37abfee010a968001e513ba5813d0d1b615 /arch/x86
parentKVM: S390: fix potential array overrun in intercept handling (diff)
downloadlinux-36cb93fd6b6bf7e9163a69a8bf20207aed5fea44.tar.xz
linux-36cb93fd6b6bf7e9163a69a8bf20207aed5fea44.zip
KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks
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(). Cc: stable@kernel.org Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6651dbf58675..b265eecc741f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5088,6 +5088,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);