From: Wei Yongjun Date: Fri, 22 Jan 2010 06:18:47 +0000 (+0800) Subject: KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=36cb93fd6b6bf7e9163a69a8bf20207aed5fea44;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Marcelo Tosatti --- 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);