diff options
| author | Tom Rini <[email protected]> | 2025-12-08 13:17:27 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-12-08 13:17:27 -0600 |
| commit | 59202e5ae76ef3acb34c4236e43248f1cd3fc642 (patch) | |
| tree | 30004ced6a059b2c25afb0aca8b049908c2212c3 /lib/efi_loader | |
| parent | 8e12d6ccb3cfa84dd275a1b852b2a235de0162b0 (diff) | |
| parent | 0e0a198a68be71148f5ec27ef86796174f91436f (diff) | |
Merge tag 'v2026.01-rc4' into next
Prepare v2026.01-rc4
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/efi_capsule.c | 34 |
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); |
