mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-17 12:41:32 +00:00
efi: Check for failure to create objects in selftest
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> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
7b78d6438a
commit
2ab7ef74cd
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue