Received: by 10.223.185.116 with SMTP id b49csp1116724wrg; Fri, 23 Feb 2018 12:12:46 -0800 (PST) X-Google-Smtp-Source: AH8x227bOExKpHqYKn7eaEVXmS1smlcCBHmIltenmvNaVo/IjH55T3n5ThoCQSjuYtHjhle/xRiW X-Received: by 2002:a17:902:710f:: with SMTP id a15-v6mr2694575pll.87.1519416766842; Fri, 23 Feb 2018 12:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519416766; cv=none; d=google.com; s=arc-20160816; b=0tyKk3lH5FsznlBuMWxszMNzMkeHLe2Ph9+hjhVu7E/E7kUjrrjVAkYxdIEWHvCWpE N/+vzecaf4GWDz7e8ZU6px4jJm2cmlhPn6VdF6zxfhgr6Ve4Vk7sZx5kZe0duCae+F8N oX2KUpMP9WOForgEpo36ATPzF6yb+jmgcjiaBDiIjIj1gj0UcMjsi6JmL0C5IXtwP66w 7U6uQOtKgiSNeQgg83UZ6lwqlXKupKA5iYrjUtUDc8pW04+qS27+CeU8YejPJ7MKc3ba ZI0qQKhZAbgcuPcn+aDIz6zG3oRdK3aKkwSXjjxEXw+lwxF3D1sx4CkbdIZOWTYOpYRl qi2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=trXJtMHPCOP+7yTpnwbNEPO+eLDAAcb5ojejMzntGNw=; b=Gjjwhfry9nRDju3wi7VIKOLIMZupM2foecrGhJL/VN1L3eaTqTeFbzDULEMVFfie2K S5yJfuZukQIkEy+tQbdjVRD+E7IJWgdp8hXBqIAZjtZt3DPtTlSQeBn86SG1QU8eFHN8 fY6+C7ZOOWwmdX9YorYmX1FYwJhqZHWpIagZ4cD7jqMPct1HsgtVqU6x56Y/qNikbJv+ 9fjldVKbAXAR7jeWmX21AHJvA9C4xcjxeWer6UpARSEIGAySU2nScs48kU5wDEjKwlTY Nrngb0kyQVGc7etokEvxqUcJmoQMys6QHQevnav5ZTAGVdbhrGQHvOQFtW0nlytvkjwU 6lIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si1863779pgn.782.2018.02.23.12.12.32; Fri, 23 Feb 2018 12:12:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933112AbeBWULc (ORCPT + 99 others); Fri, 23 Feb 2018 15:11:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40676 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932899AbeBWSlj (ORCPT ); Fri, 23 Feb 2018 13:41:39 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0C3951291; Fri, 23 Feb 2018 18:41:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Hildenbrand , Paolo Bonzini , Jack Wang Subject: [PATCH 4.4 188/193] KVM: nVMX: kmap() cant fail Date: Fri, 23 Feb 2018 19:27:01 +0100 Message-Id: <20180223170355.693925681@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Hildenbrand commit 42cf014d38d8822cce63703a467e00f65d000952 upstream. kmap() can't fail, therefore it will always return a valid pointer. Let's just get rid of the unnecessary checks. Signed-off-by: David Hildenbrand Signed-off-by: Paolo Bonzini [jwang: port to 4.4] Signed-off-by: Jack Wang Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 9 --------- 1 file changed, 9 deletions(-) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4532,10 +4532,6 @@ static int vmx_complete_nested_posted_in return 0; vapic_page = kmap(vmx->nested.virtual_apic_page); - if (!vapic_page) { - WARN_ON(1); - return -ENOMEM; - } __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page); kunmap(vmx->nested.virtual_apic_page); @@ -9238,11 +9234,6 @@ static inline bool nested_vmx_merge_msr_ return false; } msr_bitmap = (unsigned long *)kmap(page); - if (!msr_bitmap) { - nested_release_page_clean(page); - WARN_ON(1); - return false; - } if (nested_cpu_has_virt_x2apic_mode(vmcs12)) { if (nested_cpu_has_apic_reg_virt(vmcs12))