summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-09-21 07:30:45 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-09-28 10:46:29 +0000
commitb7213bbd59833fb0786c83a28df5f8244602ab5e (patch)
tree520f0a1639822567732b97c1a65d55fc11329707 /OvmfPkg
parentd63242bd69a0e3eaa39afd644b634f60f384b278 (diff)
downloadedk2-b7213bbd59833fb0786c83a28df5f8244602ab5e.tar.gz
edk2-b7213bbd59833fb0786c83a28df5f8244602ab5e.tar.bz2
edk2-b7213bbd59833fb0786c83a28df5f8244602ab5e.zip
OvmfPkg/QemuBootOrderLib: skip unsupported entries in StoreQemuBootOrder
When finding an unsupported entry just skip over and continue with the next entry instead of stop processing altogether. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
index 374c6d8f5e..18646daa67 100644
--- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
+++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
@@ -1775,34 +1775,38 @@ StoreQemuBootOrder (
Translated,
&TranslatedSize
);
- while (!RETURN_ERROR (Status)) {
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ while (Status == EFI_SUCCESS ||
+ Status == EFI_UNSUPPORTED)
+ {
+ if (Status == EFI_SUCCESS) {
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- //
- // Convert the UEFI devpath prefix to binary representation.
- //
- ASSERT (Translated[TranslatedSize] == L'\0');
- DevicePath = ConvertTextToDevicePath (Translated);
- if (DevicePath == NULL) {
- Status = RETURN_OUT_OF_RESOURCES;
- goto FreeExtraPciRoots;
- }
+ //
+ // Convert the UEFI devpath prefix to binary representation.
+ //
+ ASSERT (Translated[TranslatedSize] == L'\0');
+ DevicePath = ConvertTextToDevicePath (Translated);
+ if (DevicePath == NULL) {
+ Status = RETURN_OUT_OF_RESOURCES;
+ goto FreeExtraPciRoots;
+ }
- UnicodeSPrint (
- VariableName,
- sizeof (VariableName),
- L"QemuBootOrder%04d",
- VariableIndex++
- );
- DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, Translated));
- gRT->SetVariable (
- VariableName,
- &gQemuBootOrderGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- GetDevicePathSize (DevicePath),
- DevicePath
- );
- FreePool (DevicePath);
+ UnicodeSPrint (
+ VariableName,
+ sizeof (VariableName),
+ L"QemuBootOrder%04d",
+ VariableIndex++
+ );
+ DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, Translated));
+ gRT->SetVariable (
+ VariableName,
+ &gQemuBootOrderGuid,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ GetDevicePathSize (DevicePath),
+ DevicePath
+ );
+ FreePool (DevicePath);
+ }
//
// Move to the next OFW devpath.