From patchwork Fri Jan 22 06:21:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 74482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0M6KLhU014961 for ; Fri, 22 Jan 2010 06:20:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544Ab0AVGUS (ORCPT ); Fri, 22 Jan 2010 01:20:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751343Ab0AVGUS (ORCPT ); Fri, 22 Jan 2010 01:20:18 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:62884 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751261Ab0AVGUR (ORCPT ); Fri, 22 Jan 2010 01:20:17 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id A964D170115; Fri, 22 Jan 2010 14:20:16 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o0M6Jktj031026; Fri, 22 Jan 2010 14:19:46 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 24875D4744; Fri, 22 Jan 2010 14:21:24 +0800 (CST) Message-ID: <4B5943E9.6040207@cn.fujitsu.com> Date: Fri, 22 Jan 2010 14:21:29 +0800 From: Wei Yongjun User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: kvm@vger.kernel.org, Avi Kivity Subject: [PATCH 2/2] KVM: x86: Fix leak of free lapic date in kvm_arch_vcpu_init() References: <4B594347.2010904@cn.fujitsu.com> In-Reply-To: <4B594347.2010904@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6651dbf..f25b52e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5072,12 +5072,13 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) GFP_KERNEL); if (!vcpu->arch.mce_banks) { r = -ENOMEM; - goto fail_mmu_destroy; + goto fail_free_lapic; } vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS; return 0; - +fail_free_lapic: + kvm_free_lapic(vcpu); fail_mmu_destroy: kvm_mmu_destroy(vcpu); fail_free_pio_data: