Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3515051imu; Mon, 7 Jan 2019 04:56:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN5dbg5o7OTgB7ZXF+HwVVAo0esEMuVwuMQfm5O6fq/ZCV+QmigwPBA+ZEnTmhIWKjV9qLnf X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr60820239plq.84.1546865776496; Mon, 07 Jan 2019 04:56:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546865776; cv=none; d=google.com; s=arc-20160816; b=HZC9qV8vLy4ANugCbfPiHUKyNyT9RiCZXSKxsZxswXKTm/3eLuLt3wh0bshv27zqbr kzDaENRJiBjjI+1KTDh24FKKdw7apr52cQ10AYGPjh7CpsSJp4ns28kAiPZZfri9secx 2YNi9zRLG94itvcZ/7CtWitIVmOiwiWkrjR0MuJ4pTjovOfmCfERVkBcDvq6a88cpcjD kne0Um3uGZzfx7PRYLxZU7PlFBJd0S/Ki2v2noqdw2LBnt9bDxfG1z/h6Zj5W8e8aQo8 +w0OXb2oGtVl2ZgBTnhaT3wuAT7QP9U2YRGqylbfUESC1bt+OFd1SheWmyyTerayvGEe 2SkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AQ1GCTkR9CzTP7Z1dC70m5LRnWEt37vvNlixo1AL3cE=; b=itB8jQX8Pe+hdgEM4ZJGIOQJedjS6UsMTUIkcGMkVSLBXiD8tAiPn10UBNfkyjQRDk e1WIwuwt1AdDuCFXEeFo7T98eocitiIFqXqNTmomgmiQnznlQxPaBgLTleOgY0BnD6BY VJUsfg+AHk0AbOGvpNDI6u7I14CGLs83u5IdrMCGwVRhSGCNvmFoyk/Ppmcakypcxseq YUD5omrT5+8ED8/2RHf1Lwvr3wK2wWWgD8Ue8QqeYalfaPAMFXvF5EviUizr6AODQnKD O1pRNP4n/v0oiDB7K+djPVvLxxxbdUxRCt9T/ryAewIxbwtmDbx5vXbkbUnficp5FPQ2 LyGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HdobDr6u; 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 g8si1273367pli.50.2019.01.07.04.56.01; Mon, 07 Jan 2019 04:56:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HdobDr6u; 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 S1727430AbfAGMxT (ORCPT + 99 others); Mon, 7 Jan 2019 07:53:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:42302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbfAGMwo (ORCPT ); Mon, 7 Jan 2019 07:52:44 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22BA920651; Mon, 7 Jan 2019 12:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546865563; bh=TzGvQU4GoNZXZpXUtiabjaWeezqaFjVcGgLE1gw8yh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HdobDr6u6Op5lChj4bWEUzDLtlsaoFvEy7u+1MfmekGZrmFc3eqbqM4GsTfFFW/Ga DkOOTeZKeILrVe+CRqBRjKQLXcTPB+F6ilenI5z4kZtIxjB4ZzDR+Us3ruvslvtClc lJC9xs7dOYvfwAnqnpqK/wzvO40ciGxQy36w8Dyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini Subject: [PATCH 4.19 094/170] KVM: nVMX: Free the VMREAD/VMWRITE bitmaps if alloc_kvm_area() fails Date: Mon, 7 Jan 2019 13:32:01 +0100 Message-Id: <20190107104504.138937127@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104452.953560660@linuxfoundation.org> References: <20190107104452.953560660@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Christopherson commit 1b3ab5ad1b8ad99bae76ec583809c5f5a31c707c upstream. Fixes: 34a1cd60d17f ("kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8011,13 +8011,16 @@ static __init int hardware_setup(void) kvm_mce_cap_supported |= MCG_LMCE_P; - return alloc_kvm_area(); + r = alloc_kvm_area(); + if (r) + goto out; + return 0; out: for (i = 0; i < VMX_BITMAP_NR; i++) free_page((unsigned long)vmx_bitmap[i]); - return r; + return r; } static __exit void hardware_unsetup(void)