summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-06 08:13:37 -0600
committerTom Rini <[email protected]>2025-12-06 08:13:37 -0600
commita1feb08d02215babc6133f5c3d19869a1a5fb2d2 (patch)
treee2a13d9af097452f0ef2142efa50e385a87e99d5 /lib
parentc98b6a6dcd1fc7bcba081fc2353954e33de5053c (diff)
parente5996e3ed350598c79cd7afaf6d4f0618598e390 (diff)
Merge tag 'efi-2026-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2026-01-rc4 CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/28652 Documentation: * Correct and add missing pytest hook script environment variable names * board: verdin-am62p: Fix boot log output * Add a page for downloading the U-Boot logo with and without text UEFI: * Fix a memory leak when retrieving device paths from boot vars
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_capsule.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 31b47a20186..eafc647f558 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -857,18 +857,9 @@ static efi_status_t get_dp_device(u16 *boot_var,
struct efi_device_path *file_dp;
efi_status_t ret;
- size = 0;
- ret = efi_get_variable_int(boot_var, &efi_global_variable_guid,
- NULL, &size, NULL, NULL);
- if (ret == EFI_BUFFER_TOO_SMALL) {
- buf = malloc(size);
- if (!buf)
- return EFI_OUT_OF_RESOURCES;
- ret = efi_get_variable_int(boot_var, &efi_global_variable_guid,
- NULL, &size, buf, NULL);
- }
- if (ret != EFI_SUCCESS)
- return ret;
+ buf = efi_get_var(boot_var, &efi_global_variable_guid, &size);
+ if (!buf)
+ return EFI_NOT_FOUND;
efi_deserialize_load_option(&lo, buf, &size);
@@ -960,22 +951,11 @@ static efi_status_t find_boot_device(void)
skip:
/* find active boot device in BootOrder */
- size = 0;
- ret = efi_get_variable_int(u"BootOrder", &efi_global_variable_guid,
- NULL, &size, NULL, NULL);
- if (ret == EFI_BUFFER_TOO_SMALL) {
- boot_order = malloc(size);
- if (!boot_order) {
- ret = EFI_OUT_OF_RESOURCES;
- goto out;
- }
-
- ret = efi_get_variable_int(u"BootOrder",
- &efi_global_variable_guid,
- NULL, &size, boot_order, NULL);
- }
- if (ret != EFI_SUCCESS)
+ boot_order = efi_get_var(u"BootOrder", &efi_global_variable_guid, &size);
+ if (!boot_order) {
+ ret = EFI_NOT_FOUND;
goto out;
+ }
/* check in higher order */
num = size / sizeof(u16);