Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934287AbcJROfP (ORCPT ); Tue, 18 Oct 2016 10:35:15 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:34877 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761771AbcJROde (ORCPT ); Tue, 18 Oct 2016 10:33:34 -0400 From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Yisheng Xie , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Catalin Marinas , Mark Rutland , Will Deacon Subject: [PATCH 3/8] efi/arm*: efi_init() error handling fix Date: Tue, 18 Oct 2016 15:33:13 +0100 Message-Id: <20161018143318.15673-4-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161018143318.15673-1-matt@codeblueprint.co.uk> References: <20161018143318.15673-1-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 990 Lines: 33 From: Yisheng Xie There's an early memmap leak in efi_init error path, fix it. Signed-off-by: Yisheng Xie Cc: Catalin Marinas Cc: Mark Rutland Cc: Will Deacon Cc: Ingo Molnar Cc: Ard Biesheuvel Signed-off-by: Matt Fleming --- drivers/firmware/efi/arm-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index 8efe13075c92..f853ad2c4ca0 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -244,8 +244,10 @@ void __init efi_init(void) "Unexpected EFI_MEMORY_DESCRIPTOR version %ld", efi.memmap.desc_version); - if (uefi_init() < 0) + if (uefi_init() < 0) { + efi_memmap_unmap(); return; + } reserve_regions(); efi_memattr_init(); -- 2.10.0