From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v16 1/4] efi: Check for failure to create objects in selftest
Date: Sun, 25 Nov 2018 20:14:36 -0700 [thread overview]
Message-ID: <20181126031439.202582-2-sjg@chromium.org> (raw)
In-Reply-To: <20181126031439.202582-1-sjg@chromium.org>
At present a few error conditions are not checked. Before refactoring
this code, add some basic checks. Note that this code still leaks memory
in the event of error. This will be tackled after the refactor.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v16:
- Add new patch to check for failure to create objects in selftest
Changes in v15: None
Changes in v14: None
Changes in v13: None
Changes in v12: None
Changes in v11: None
Changes in v9: None
Changes in v7: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
cmd/bootefi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 3e37805ea13..5be10c9b832 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -532,7 +532,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
bootefi_device_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
(uintptr_t)&efi_selftest,
(uintptr_t)&efi_selftest);
+ if (!bootefi_device_path)
+ return CMD_RET_FAILURE;
+
bootefi_image_path = efi_dp_from_file(NULL, 0, "\\selftest");
+ if (!bootefi_image_path)
+ return CMD_RET_FAILURE;
r = efi_setup_loaded_image(bootefi_device_path,
bootefi_image_path, &image_obj,
--
2.20.0.rc0.387.gc7a69e6b6c-goog
next prev parent reply other threads:[~2018-11-26 3:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 3:14 [U-Boot] [PATCH v16 0/4] efi_loader: Code refactoring and improvement Simon Glass
2018-11-26 3:14 ` Simon Glass [this message]
2018-11-30 23:21 ` [U-Boot] [U-Boot, v16, 1/4] efi: Check for failure to create objects in selftest Alexander Graf
2018-11-26 3:14 ` [U-Boot] [PATCH v16 2/4] efi: Split out test init/uninit into functions Simon Glass
2018-11-30 23:21 ` [U-Boot] [U-Boot, v16, " Alexander Graf
2018-11-26 3:14 ` [U-Boot] [PATCH v16 3/4] efi: Create a function to set up for running EFI code Simon Glass
2018-11-30 23:21 ` [U-Boot] [U-Boot, v16, " Alexander Graf
2018-11-26 3:14 ` [U-Boot] [PATCH v16 4/4] efi: Rename bootefi_test_finish() to bootefi_run_finish() Simon Glass
2018-11-30 23:21 ` [U-Boot] [U-Boot, v16, " Alexander Graf
2018-11-29 21:26 ` [U-Boot] [PATCH v16 0/4] efi_loader: Code refactoring and improvement Simon Glass
2018-11-30 21:27 ` Alexander Graf
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=20181126031439.202582-2-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.