lkml.org 
[lkml]   [2010]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[91/98] KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks
    2.6.32-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Wei Yongjun <yjwei@cn.fujitsu.com>

    commit 36cb93fd6b6bf7e9163a69a8bf20207aed5fea44 upstream.

    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>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    arch/x86/kvm/x86.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/arch/x86/kvm/x86.c
    +++ b/arch/x86/kvm/x86.c
    @@ -4782,6 +4782,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);



    \
     
     \ /
      Last update: 2010-01-27 00:51    [W:0.021 / U:32.540 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site