Received: by 10.223.185.116 with SMTP id b49csp1089338wrg; Fri, 23 Feb 2018 11:44:41 -0800 (PST) X-Google-Smtp-Source: AH8x2247l10qHwoYnl6f3K9G3mrFsrBPrxt2WNCk19mckpsCb8Mgx4aqXrhTpqBF0M3mldWSubG7 X-Received: by 10.98.231.26 with SMTP id s26mr2802704pfh.210.1519415081778; Fri, 23 Feb 2018 11:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415081; cv=none; d=google.com; s=arc-20160816; b=VUJrBTv5oXknf+F/ocBU/SCmU2jj0qKE9uaVYKWaGFRs1sNcy1ogI2uSeHHXhvTvCO fsumjBjSwMQPNiL3agZBtdP4lhOL9bNLH9xelhGC2okt0TeLM5oGKz8AIXXQNTFGTtby 0lc5Y5wQBUC9IVMpaD868pjKsBXLa0WTfOHe9SN2jdAIlyhI4EI7lp+D5S81pqJC4quH +m2nBEn0+9yNgsvrNEIXceB9XnMZ2gFQh00fE7aZPgTfTE4ta0maS9iqC0+/kUAXA3Y3 PZlF9TBwUAEcGjm1KU/E8DAgf7wnMWI3Vsw0gb50G/hSSefczHKr0sfpkBsIHtvA8rzo 4tLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=UVujYbHXnk76bqa6sLpjgiLaK2vjCtmbFrPi8r039vM=; b=hX2q1y2p4HwASvOBjCF8CtfqjOObH/62L06yHlnTNjV35ys/wkHV4y4Clyv2gwFR4n +EzpdBAp34aIbaEN6zVxnSpnz4ESkArxPrlQbJTPxaD4m29kLgXj5O54dNqSh7i0EiI9 P9ubs+jvF1B0p7smuqlpLT6NY591ZYrCHCrVc6Fhh0C2NG925AZmjubtn6Net41RDwYY D8YucVmuN4lG3swODMgkUNbFHpUSCKAjqh7FZ/bPDyNUmVNEWm91sLoh2u2Bov85UuEs hbtDXcnXhj31mcIOIUMqRbV9MJimg6GQUxgaozku1mIiLBExH7jp7EwPzBWaOlHHO3LM yPtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=XVx2Ae8X; dkim=pass header.i=@codeaurora.org header.s=default header.b=NB9hnvC+; 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 i10-v6si2254540plr.670.2018.02.23.11.44.27; Fri, 23 Feb 2018 11:44:41 -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=@codeaurora.org header.s=default header.b=XVx2Ae8X; dkim=pass header.i=@codeaurora.org header.s=default header.b=NB9hnvC+; 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 S934444AbeBWTnX (ORCPT + 99 others); Fri, 23 Feb 2018 14:43:23 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57392 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754822AbeBWTmj (ORCPT ); Fri, 23 Feb 2018 14:42:39 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0C1EA60BEB; Fri, 23 Feb 2018 19:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414959; bh=YBjBen92u8O6t2cxPRG1MkiRTP2VGQ7RqQKAtzCC9W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XVx2Ae8X1XegKijyKYO39X6O5fQSlV1h+4uIajcjZS0kxmdHfK41DJdyyJ5gkSOs9 ye0EPaj5kpy3G0fOR1DRuQJxGOXdv7N1OiucXzNBGcPyOTyVFwYuMv5sp8OL5bjAJx rR1R0tWlY5uHe0ShY+VDNXLSQNtFO93w6hkQ7J9s= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from tbaicar-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tbaicar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DD03960848; Fri, 23 Feb 2018 19:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414958; bh=YBjBen92u8O6t2cxPRG1MkiRTP2VGQ7RqQKAtzCC9W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NB9hnvC+T1U8aJsHj/NG48WXbP70kWqcLdDrBtbe4zYZAOA+yrAN3ZRftE5HjWNNw u10GJsu36vYv+ZkYNz/jzl5nPnJDwfz4WBwoHshBrKtSHHxbiNJGjzGjPpSg9i8x0T JaqSSOyH50uG5qlqL7LzBm7EpULeB0FwLDKaVxbE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DD03960848 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org From: Tyler Baicar To: ard.biesheuvel@linaro.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, jhugo@codeaurora.org, sgoel@codeaurora.org, takahiro.akashi@linaro.org, timur@codeaurora.org Cc: Tyler Baicar Subject: [PATCH 1/2] efi/esrt: fix unsupported version initialization failure Date: Fri, 23 Feb 2018 12:42:32 -0700 Message-Id: <1519414953-5478-2-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> References: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If ESRT initialization fails due to an unsupported version, the early_memremap allocation is never unmapped. This will cause an early ioremap leak. So, make sure to unmap the memory allocation before returning from efi_esrt_init(). Signed-off-by: Tyler Baicar --- drivers/firmware/efi/esrt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index c47e0c6..504f3c3 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -285,7 +285,7 @@ void __init efi_esrt_init(void) } else { pr_err("Unsupported ESRT version %lld.\n", tmpesrt.fw_resource_version); - return; + goto err_memunmap; } if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) { -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.