summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-22 17:15:23 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-22 17:15:23 +0000
commitc119933d025bf5fab9208c9d5cdb31f20eb966ea (patch)
tree52df91c63c91fc90805b2fc903d353fb45c5103b /MdePkg
parent7102b199613eaef6d28e89f72783e35f15cf6b8c (diff)
downloadedk2-c119933d025bf5fab9208c9d5cdb31f20eb966ea.tar.gz
edk2-c119933d025bf5fab9208c9d5cdb31f20eb966ea.tar.bz2
edk2-c119933d025bf5fab9208c9d5cdb31f20eb966ea.zip
MdePkg DxeServicesLib: Search further in GetFileBufferByFilePath
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
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/DxeServicesLib/DxeServicesLib.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
index d8e6b5cc4e..5c4a182a4a 100644
--- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
+++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
@@ -704,7 +704,9 @@ GetFileBufferByFilePath (
}
}
}
- goto Finish;
+ if (!EFI_ERROR (Status)) {
+ goto Finish;
+ }
}
//
@@ -728,8 +730,11 @@ GetFileBufferByFilePath (
TempDevicePathNode = DuplicateDevicePath (DevicePathNode);
if (TempDevicePathNode == NULL) {
FileHandle->Close (FileHandle);
+ //
+ // Setting Status to an EFI_ERROR value will cause the rest of
+ // the file system support below to be skipped.
+ //
Status = EFI_OUT_OF_RESOURCES;
- goto Finish;
}
//
// Parse each MEDIA_FILEPATH_DP node. There may be more than one, since the
@@ -737,7 +742,7 @@ GetFileBufferByFilePath (
// our way down each device path node and close the previous node
//
DevicePathNode = TempDevicePathNode;
- while (!IsDevicePathEnd (DevicePathNode) && !EFI_ERROR (Status)) {
+ while (!EFI_ERROR (Status) && !IsDevicePathEnd (DevicePathNode)) {
if (DevicePathType (DevicePathNode) != MEDIA_DEVICE_PATH ||
DevicePathSubType (DevicePathNode) != MEDIA_FILEPATH_DP) {
Status = EFI_UNSUPPORTED;
@@ -816,10 +821,14 @@ GetFileBufferByFilePath (
if (FileHandle != NULL) {
FileHandle->Close (FileHandle);
}
- FreePool (TempDevicePathNode);
+ if (TempDevicePathNode != NULL) {
+ FreePool (TempDevicePathNode);
+ }
}
}
- goto Finish;
+ if (!EFI_ERROR (Status)) {
+ goto Finish;
+ }
}
//
@@ -858,7 +867,9 @@ GetFileBufferByFilePath (
}
}
}
- goto Finish;
+ if (!EFI_ERROR (Status)) {
+ goto Finish;
+ }
}
}