From patchwork Fri Jan 22 08:55:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 74496 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 o0M8sTc6003232 for ; Fri, 22 Jan 2010 08:54:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338Ab0AVIy1 (ORCPT ); Fri, 22 Jan 2010 03:54:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751657Ab0AVIy1 (ORCPT ); Fri, 22 Jan 2010 03:54:27 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:63773 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751493Ab0AVIy0 (ORCPT ); Fri, 22 Jan 2010 03:54:26 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 9219C17008D; Fri, 22 Jan 2010 16:54:23 +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 o0M8rrjZ006106; Fri, 22 Jan 2010 16:53:53 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 1E873D4744; Fri, 22 Jan 2010 16:55:31 +0800 (CST) Message-ID: <4B5967E9.6060807@cn.fujitsu.com> Date: Fri, 22 Jan 2010 16:55:05 +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] KVM: MMU: Remove some useless code from alloc_mmu_pages() 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/mmu.c b/arch/x86/kvm/mmu.c index 4c3e5b2..5d8e01b 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2849,16 +2849,13 @@ static int alloc_mmu_pages(struct kvm_vcpu *vcpu) */ page = alloc_page(GFP_KERNEL | __GFP_DMA32); if (!page) - goto error_1; + return -ENOMEM; + vcpu->arch.mmu.pae_root = page_address(page); for (i = 0; i < 4; ++i) vcpu->arch.mmu.pae_root[i] = INVALID_PAGE; return 0; - -error_1: - free_mmu_pages(vcpu); - return -ENOMEM; } int kvm_mmu_create(struct kvm_vcpu *vcpu)