]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg DxeServicesLib: Search further in GetFileBufferByFilePath
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Nov 2011 17:15:23 +0000 (17:15 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Nov 2011 17:15:23 +0000 (17:15 +0000)
This function supports loading via these interfaces, in order:
* gEfiFirmwareVolume2ProtocolGuid
* gEfiSimpleFileSystemProtocolGuid
* gEfiLoadFile2ProtocolGuid
* gEfiLoadFileProtocolGuid

Previously, if a device path supported any of these interfaces,
it would only check that interface.  (If it failed to load via
that interface, it would not move on and check the others.)

This change causes the other interfaces to still be checked if
the previous ones fail.

Signed-off-by: jljusten
Reviewed-by: mdkinney
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12761 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/DxeServicesLib/DxeServicesLib.c

index d8e6b5cc4e404ccd86fa663d04fdeb9e860d0353..5c4a182a4a5a59bb371cafde54864be31a6dabeb 100644 (file)
@@ -704,7 +704,9 @@ GetFileBufferByFilePath (
         }\r
       }\r
     }\r
-    goto Finish;\r
+    if (!EFI_ERROR (Status)) {\r
+      goto Finish;\r
+    }\r
   }\r
 \r
   //\r
@@ -728,8 +730,11 @@ GetFileBufferByFilePath (
         TempDevicePathNode = DuplicateDevicePath (DevicePathNode);\r
         if (TempDevicePathNode == NULL) {\r
           FileHandle->Close (FileHandle);\r
+          //\r
+          // Setting Status to an EFI_ERROR value will cause the rest of\r
+          // the file system support below to be skipped.\r
+          //\r
           Status = EFI_OUT_OF_RESOURCES;\r
-          goto Finish;\r
         }\r
         //\r
         // Parse each MEDIA_FILEPATH_DP node. There may be more than one, since the\r
@@ -737,7 +742,7 @@ GetFileBufferByFilePath (
         // our way down each device path node and close the previous node\r
         //\r
         DevicePathNode = TempDevicePathNode;\r
-        while (!IsDevicePathEnd (DevicePathNode) && !EFI_ERROR (Status)) {\r
+        while (!EFI_ERROR (Status) && !IsDevicePathEnd (DevicePathNode)) {\r
           if (DevicePathType (DevicePathNode) != MEDIA_DEVICE_PATH ||\r
               DevicePathSubType (DevicePathNode) != MEDIA_FILEPATH_DP) {\r
             Status = EFI_UNSUPPORTED;\r
@@ -816,10 +821,14 @@ GetFileBufferByFilePath (
         if (FileHandle != NULL) {\r
           FileHandle->Close (FileHandle);\r
         }\r
-        FreePool (TempDevicePathNode);\r
+        if (TempDevicePathNode != NULL) {\r
+          FreePool (TempDevicePathNode);\r
+        }\r
       }\r
     }\r
-    goto Finish;\r
+    if (!EFI_ERROR (Status)) {\r
+      goto Finish;\r
+    }\r
   }\r
 \r
   //\r
@@ -858,7 +867,9 @@ GetFileBufferByFilePath (
           }\r
         }\r
       }\r
-      goto Finish;\r
+      if (!EFI_ERROR (Status)) {\r
+        goto Finish;\r
+      }\r
     }\r
   }\r
 \r