From: Matt Fleming <matt@codeblueprint.co.uk>
To: Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>
Cc: Yisheng Xie <xieyisheng1@huawei.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
Matt Fleming <matt@codeblueprint.co.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will.deacon@arm.com>
Subject: [PATCH 3/8] efi/arm*: efi_init() error handling fix
Date: Tue, 18 Oct 2016 15:33:13 +0100 [thread overview]
Message-ID: <20161018143318.15673-4-matt@codeblueprint.co.uk> (raw)
In-Reply-To: <20161018143318.15673-1-matt@codeblueprint.co.uk>
From: Yisheng Xie <xieyisheng1@huawei.com>
There's an early memmap leak in efi_init error path, fix it.
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
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
next prev parent reply other threads:[~2016-10-18 14:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 14:33 [GIT PULL 0/8] EFI changes for v4.10 Matt Fleming
2016-10-18 14:33 ` [PATCH 1/8] MAINTAINERS: add myself as EFI maintainer Matt Fleming
2016-10-18 15:28 ` [tip:efi/core] MAINTAINERS: Add " tip-bot for Ard Biesheuvel
2016-10-18 14:33 ` [PATCH 2/8] efi: Remove unused including <linux/version.h> Matt Fleming
2016-10-18 15:28 ` [tip:efi/core] efi: Remove unused include of <linux/version.h> tip-bot for Wei Yongjun
2016-10-18 14:33 ` Matt Fleming [this message]
2016-10-18 15:29 ` [tip:efi/core] efi/arm*: Fix efi_init() error handling tip-bot for Yisheng Xie
2016-10-18 14:33 ` [PATCH 4/8] efi/efi_test: Fix the uninitialized value datasize Matt Fleming
2016-10-18 15:29 ` [tip:efi/core] efi/efi_test: Fix uninitialized variable 'datasize' tip-bot for Ivan Hu
2016-10-18 14:33 ` [PATCH 5/8] efi/efi_test: Fix the uninitialized value rv Matt Fleming
2016-10-18 15:30 ` [tip:efi/core] efi/efi_test: Fix uninitialized variable 'rv' tip-bot for Ivan Hu
2016-10-18 14:33 ` [PATCH 6/8] efi/efi_test: Use memdup_user() as a cleanup Matt Fleming
2016-10-18 15:30 ` [tip:efi/core] " tip-bot for Ivan Hu
2016-10-18 14:33 ` [PATCH 7/8] efifb: show framebuffer layout as device attributes Matt Fleming
2016-10-18 15:31 ` [tip:efi/core] efifb: Show " tip-bot for Peter Jones
2016-10-18 14:33 ` [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure Matt Fleming
2016-10-18 15:31 ` [tip:efi/core] efi/efivar_ssdt_load: " tip-bot for Dan Carpenter
2016-10-18 15:25 ` [GIT PULL 0/8] EFI changes for v4.10 Ingo Molnar
2016-10-18 15:29 ` Ard Biesheuvel
2016-10-18 15:34 ` Lukas Wunner
2016-10-18 15:40 ` Matt Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161018143318.15673-4-matt@codeblueprint.co.uk \
--to=matt@codeblueprint.co.uk \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=hpa@zytor.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
--cc=xieyisheng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome