Received: by 10.223.176.5 with SMTP id f5csp710229wra; Fri, 9 Feb 2018 06:03:55 -0800 (PST) X-Google-Smtp-Source: AH8x225E0CozvjJRNmAcLRTN9q2zNHG5r/m0ykT+qaE9tUn09qzKBlnNxoW+wIN2TQiPih1guPTm X-Received: by 2002:a17:902:aa45:: with SMTP id c5-v6mr2673400plr.93.1518185035640; Fri, 09 Feb 2018 06:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518185035; cv=none; d=google.com; s=arc-20160816; b=mb5K8cHT2FyZMBUHoSqPhgdQhYKB2IrAsLO2GDpq4D8rPi5clY6hznW+CLxvE3lQmr 2Ss9VXFSfeukU3jOFg6WoKN/td4b3lOfoXrXdFGuinhFUmjS7oPFb+bdZ6QqyFMvCFla IG9Zlmaj6IdVQJ8kZJ70+lXIZiBDS+kE5ihxUbXPXJYM1BDKtprSF1owOV9Ai1NV4Lbt 1iv0ahD80UPeZBEpWRWKGEHUp6dXXByip/VjQ0O4/x4sYvjQ/clIXsuO/Rg0GSt7MRgh ozDqQ5tWnturviYjezB0Bsbj6z3zOrjj2rPaSBVHY0sZEq6bS+Pow4FD1nssVR0IB174 HwpQ== 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=BCx3sRTJLEyWNqUzY6Yzm3ktLr9M5h3k/ox89elNWY4=; b=ek91zbNk7RR25WF2DXjRg5yD5mkrFeHdMTJZKDV7H8VIx7UiRpy0ONZK8JPOyJ7TmJ hODdkkeV8JbNUGjNhk+KdowE2zdAEhZsn621fbDVy7mPmjhi/J7leAx9ALD4qgftrPED uFfO1gp0QHtX33T2E0uNAdeSdRrXKvVjWXAWG+wModE6vB7fYCTEu7VWpp8zhWWl6lhc TjMeelIMcfSjbZI6vkdg5X/UhwUMA7kwrizVdr5kzwzgrpn8281vVLQ4hso56bmbuSjs Q0iLCdHgovDHw/vMe6laO7V2LxhFkytVRQunlOXVmEmCgYSt398KtJmDtSQQiPdz54UQ eNpg== 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 m27si1774062pfg.64.2018.02.09.06.03.40; Fri, 09 Feb 2018 06:03:55 -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 S1753349AbeBINnw (ORCPT + 99 others); Fri, 9 Feb 2018 08:43:52 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51096 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbeBINnu (ORCPT ); Fri, 9 Feb 2018 08:43:50 -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 997E9FA5; Fri, 9 Feb 2018 13:43:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Hildenbrand , Paolo Bonzini Subject: [PATCH 4.9 76/92] KVM: nVMX: kmap() cant fail Date: Fri, 9 Feb 2018 14:39:45 +0100 Message-Id: <20180209133936.717041802@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 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.9-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 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 @@ -4756,10 +4756,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); @@ -9584,11 +9580,6 @@ static inline bool nested_vmx_merge_msr_ if (!page) return false; msr_bitmap_l1 = (unsigned long *)kmap(page); - if (!msr_bitmap_l1) { - nested_release_page_clean(page); - WARN_ON(1); - return false; - } memset(msr_bitmap_l0, 0xff, PAGE_SIZE);