mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 14:25:56 +00:00
Fix incorrect return code of boot option update
Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
339b527bd4
commit
9945bc4f86
3 changed files with 8 additions and 4 deletions
|
@ -352,7 +352,7 @@ static struct bootmenu_data *bootmenu_create(int delay)
|
||||||
* a architecture-specific default image name such as BOOTAA64.EFI.
|
* a architecture-specific default image name such as BOOTAA64.EFI.
|
||||||
*/
|
*/
|
||||||
efi_ret = efi_bootmgr_update_media_device_boot_option();
|
efi_ret = efi_bootmgr_update_media_device_boot_option();
|
||||||
if (efi_ret != EFI_SUCCESS && efi_ret != EFI_NOT_FOUND)
|
if (efi_ret != EFI_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = prepare_uefi_bootorder_entry(menu, &iter, &i);
|
ret = prepare_uefi_bootorder_entry(menu, &iter, &i);
|
||||||
|
|
|
@ -2314,7 +2314,7 @@ static int do_eficonfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const a
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
|
|
||||||
ret = efi_bootmgr_update_media_device_boot_option();
|
ret = efi_bootmgr_update_media_device_boot_option();
|
||||||
if (ret != EFI_SUCCESS && ret != EFI_NOT_FOUND)
|
if (ret != EFI_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -660,11 +660,13 @@ efi_status_t efi_bootmgr_update_media_device_boot_option(void)
|
||||||
NULL, &count,
|
NULL, &count,
|
||||||
(efi_handle_t **)&volume_handles);
|
(efi_handle_t **)&volume_handles);
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
opt = calloc(count, sizeof(struct eficonfig_media_boot_option));
|
opt = calloc(count, sizeof(struct eficonfig_media_boot_option));
|
||||||
if (!opt)
|
if (!opt) {
|
||||||
|
ret = EFI_OUT_OF_RESOURCES;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/* enumerate all devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL */
|
/* enumerate all devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL */
|
||||||
ret = efi_bootmgr_enumerate_boot_option(opt, volume_handles, count);
|
ret = efi_bootmgr_enumerate_boot_option(opt, volume_handles, count);
|
||||||
|
@ -717,5 +719,7 @@ out:
|
||||||
free(opt);
|
free(opt);
|
||||||
efi_free_pool(volume_handles);
|
efi_free_pool(volume_handles);
|
||||||
|
|
||||||
|
if (ret == EFI_NOT_FOUND)
|
||||||
|
return EFI_SUCCESS;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue