- if (ret == EFI_NOT_FOUND) {
- printf("BootOrder not defined\n");
- ret = CMD_RET_SUCCESS;
- goto out;
- } else if (ret != EFI_SUCCESS) {
+ bootorder = malloc(size);
+ if (!bootorder) {
+ printf("ERROR: Out of memory\n");
+ return CMD_RET_FAILURE;
+ }
+ ret = EFI_CALL(efi_get_variable(L"BootOrder", &efi_global_variable_guid,
+ NULL, &size, bootorder));
+ if (ret != EFI_SUCCESS) {