diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2010-01-22 14:18:47 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-28 15:02:47 -0800 |
commit | 8e5c20d09b0003c91a96e35f7117633eefe2545a (patch) | |
tree | a3285834e374317d1e7536e49b50df3abcae3da2 /arch | |
parent | 0118bac21740345d8b4754da24f6ce1aab4a91bf (diff) |
KVM: x86: Fix probable memory leak of vcpu->arch.mce_banks
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>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 97b31fa6308..1bd161ed168 100644 --- 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); |