From: Gleb Natapov Subject: Re: [PATCH] KVM: x86: fix memory leak in vmx_init Date: Mon, 8 Apr 2013 10:56:22 +0300 Message-ID: <20130408075622.GB17919@redhat.com> References: <1365405993-29792-1-git-send-email-yang.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Yang Zhang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17365 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934313Ab3DHH41 (ORCPT ); Mon, 8 Apr 2013 03:56:27 -0400 Content-Disposition: inline In-Reply-To: <1365405993-29792-1-git-send-email-yang.z.zhang@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 08, 2013 at 03:26:33PM +0800, Yang Zhang wrote: > From: Yang Zhang > > Free vmx_msr_bitmap_longmode_x2apic and vmx_msr_bitmap_longmode if > kvm_init() fails. > > Signed-off-by: Yang Zhang > --- Applied, thanks. > arch/x86/kvm/vmx.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 03f5746..c6da8c5 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -7741,7 +7741,7 @@ static int __init vmx_init(void) > r = kvm_init(&vmx_x86_ops, sizeof(struct vcpu_vmx), > __alignof__(struct vcpu_vmx), THIS_MODULE); > if (r) > - goto out3; > + goto out5; > > #ifdef CONFIG_KEXEC > rcu_assign_pointer(crash_vmclear_loaded_vmcss, > @@ -7789,6 +7789,8 @@ static int __init vmx_init(void) > > return 0; > > +out5: > + free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic); > out4: > free_page((unsigned long)vmx_msr_bitmap_longmode); > out3: > -- > 1.7.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Gleb.