]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/QemuBootOrderLib: skip unsupported entries in StoreQemuBootOrder
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Sep 2022 05:30:45 +0000 (07:30 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 28 Sep 2022 10:46:29 +0000 (10:46 +0000)
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>
OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c

index 374c6d8f5e9152352a1bdbc8d0f4aaceead943ab..18646daa67e3247403628bba0774d3025736f53b 100644 (file)
@@ -1775,34 +1775,38 @@ StoreQemuBootOrder (
                      Translated,\r
                      &TranslatedSize\r
                      );\r
-  while (!RETURN_ERROR (Status)) {\r
-    EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  while (Status == EFI_SUCCESS ||\r
+         Status == EFI_UNSUPPORTED)\r
+  {\r
+    if (Status == EFI_SUCCESS) {\r
+      EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
 \r
-    //\r
-    // Convert the UEFI devpath prefix to binary representation.\r
-    //\r
-    ASSERT (Translated[TranslatedSize] == L'\0');\r
-    DevicePath = ConvertTextToDevicePath (Translated);\r
-    if (DevicePath == NULL) {\r
-      Status = RETURN_OUT_OF_RESOURCES;\r
-      goto FreeExtraPciRoots;\r
-    }\r
+      //\r
+      // Convert the UEFI devpath prefix to binary representation.\r
+      //\r
+      ASSERT (Translated[TranslatedSize] == L'\0');\r
+      DevicePath = ConvertTextToDevicePath (Translated);\r
+      if (DevicePath == NULL) {\r
+        Status = RETURN_OUT_OF_RESOURCES;\r
+        goto FreeExtraPciRoots;\r
+      }\r
 \r
-    UnicodeSPrint (\r
-      VariableName,\r
-      sizeof (VariableName),\r
-      L"QemuBootOrder%04d",\r
-      VariableIndex++\r
-      );\r
-    DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, Translated));\r
-    gRT->SetVariable (\r
-           VariableName,\r
-           &gQemuBootOrderGuid,\r
-           EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-           GetDevicePathSize (DevicePath),\r
-           DevicePath\r
-           );\r
-    FreePool (DevicePath);\r
+      UnicodeSPrint (\r
+        VariableName,\r
+        sizeof (VariableName),\r
+        L"QemuBootOrder%04d",\r
+        VariableIndex++\r
+        );\r
+      DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, Translated));\r
+      gRT->SetVariable (\r
+             VariableName,\r
+             &gQemuBootOrderGuid,\r
+             EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+             GetDevicePathSize (DevicePath),\r
+             DevicePath\r
+             );\r
+      FreePool (DevicePath);\r
+    }\r
 \r
     //\r
     // Move to the next OFW devpath.\r