Received: by 10.223.185.116 with SMTP id b49csp1582854wrg; Fri, 23 Feb 2018 23:21:57 -0800 (PST) X-Google-Smtp-Source: AH8x227644HC4eMOtHe8GxATcFP4vmm59q3v/phKRV88hK6+cfnOPu7wU1TSkF70aForsQN9LDB4 X-Received: by 2002:a17:902:b613:: with SMTP id b19-v6mr4100755pls.173.1519456917558; Fri, 23 Feb 2018 23:21:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519456917; cv=none; d=google.com; s=arc-20160816; b=vJq7DlJTEUH8DABxjc28nKCfXKxG7H1buz0y99KeKrjEFWV/g0kpo1ntfk0NBo67dt BHb9euOgoZ9A38hggdTyoyTdV1a+2mI/m4Y7tTZ1hFKSxg4qFFTyjAC5CwGSv8WJaETx vLlvjYuN3kDcsR2gkBoDA5rEV6ODlyvCySxuJyMEl7U5uhCBF3fnBXJn6YmpWdeFYYHR yZPifmaA2Cg8Dsqh/u7Zp6ZPed7Kk5dEwNkfy786EZOrvsp9mn8fzrLe2ywz0A77BZ6S eYrs2GLS7zkORu8rUquPDSUHecAjjn5gCRuQ9VlEeKt9Lbk53hnN67Ev8RwtONWcyaNB jdJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ub3Xz3FizvAxplupZBB0a+PBzMXc7z7jbKSVGmLV6L4=; b=dUS85lL+UEkmpjFCfhAnuKzlgIObzQJ2r30ses2nEXli2fIylchuU7QK4pGpWlFMRy F33/YjSXhuIJDymug+y1Wn5LxPXLvgKd1JVyzKvNgKPAuz2+zUK/ZT9564keAbIvEDCT QPJpzX7J0sPpVEX3eQkfU4kqne4yFfdz7kg0lmJFLSdkiCGCQ8N6J9T288i6t/g7dnaV J6APZFH0BF1iO+9YgBrVZ01u9OGxVnq3RCsHeM3xLyqESgnbK/x75j92HP3AEAqljtKD JMRqmmJqKcrXAMP1lozV5gFQxRg1PHRsUxWHleFE8MpdzJxpNkHzCN3w/bG7q+PJ/jWo 68qA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f84si3139667pfe.128.2018.02.23.23.21.42; Fri, 23 Feb 2018 23:21:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbeBXHVE (ORCPT + 99 others); Sat, 24 Feb 2018 02:21:04 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750710AbeBXHVD (ORCPT ); Sat, 24 Feb 2018 02:21:03 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FB9AEAEA0; Sat, 24 Feb 2018 07:21:02 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (unknown [10.66.129.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA6712024CA9; Sat, 24 Feb 2018 07:20:58 +0000 (UTC) Date: Sat, 24 Feb 2018 15:20:54 +0800 From: Dave Young To: Tyler Baicar Cc: 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 Subject: Re: [PATCH 1/2] efi/esrt: fix unsupported version initialization failure Message-ID: <20180224072054.GA3264@dhcp-128-65.nay.redhat.com> References: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> <1519414953-5478-2-git-send-email-tbaicar@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519414953-5478-2-git-send-email-tbaicar@codeaurora.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 24 Feb 2018 07:21:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 24 Feb 2018 07:21:02 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dyoung@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/18 at 12:42pm, Tyler Baicar wrote: > 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. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-efi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Dave Young Thanks Dave