Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback: find_boot_option() needs to return the index for the boot entry in optnum #396

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions fallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,15 @@ find_boot_option(EFI_DEVICE_PATH *dp, EFI_DEVICE_PATH *fulldp,
first_new_option_size = StrLen(arguments) * sizeof (CHAR16);
}

*optnum = xtoi(varname + 4);
FreePool(candidate);
FreePool(data);
return EFI_SUCCESS;
/* find the index for the matching entry in BootOrder */
UINT16 bootnum = xtoi(varname + 4);
for (*optnum = 0; *optnum < nbootorder; (*optnum)++) {
if (bootorder[*optnum] == bootnum) {
FreePool(candidate);
FreePool(data);
return EFI_SUCCESS;
}
}
}
FreePool(candidate);
FreePool(data);
Expand Down