From: Lenny Szubowicz <lszubowi@redhat.com>
To: ardb@kernel.org, eric.snowberg@oracle.com, mingo@kernel.org,
nivedita@alum.mit.edu, tglx@linutronix.de,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] efi/libstub/x86: Free EFI map buffer in allocate_e820()
Date: Tue, 5 May 2020 15:00:16 -0400 [thread overview]
Message-ID: <20200505190016.4350-1-lszubowi@redhat.com> (raw)
In allocate_e820(), free the EFI map buffer that has been returned
by efi_get_memory_map(). The returned size of the EFI map buffer
is used to allocate an adequately sized e820ext buffer, if it's
needed. But the contents of that EFI map buffer is not used at all
and the local pointer to it is gone on return from allocate_e820().
Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
---
drivers/firmware/efi/libstub/x86-stub.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 05ccb229fb45..4efe3e7a218d 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -623,6 +623,9 @@ static efi_status_t allocate_e820(struct boot_params *params,
if (status != EFI_SUCCESS)
return status;
+ /* Allocated EFI map buf is not used here. Just need its size. */
+ efi_bs_call(free_pool, map);
+
nr_desc = buff_size / desc_size;
if (nr_desc > ARRAY_SIZE(params->e820_table)) {
--
2.18.4
next reply other threads:[~2020-05-05 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 19:00 Lenny Szubowicz [this message]
2020-05-06 7:23 ` Ard Biesheuvel
2020-05-07 1:49 ` Lenny Szubowicz
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=20200505190016.4350-1-lszubowi@redhat.com \
--to=lszubowi@redhat.com \
--cc=ardb@kernel.org \
--cc=eric.snowberg@oracle.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=nivedita@alum.mit.edu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®