summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_file.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-02-18 15:48:01 -0500
committerTom Rini <trini@konsulko.com>2019-02-18 15:48:01 -0500
commitbeff8e34b22d708df11b32b6ed27be49ba345875 (patch)
tree24e03177fb25d4721a77ddaa38218579c3455353 /lib/efi_loader/efi_file.c
parent500ad54e35c636b0a05170753da58fcd8c8de6f2 (diff)
parent997fc12ec91eccf6b7485565864f3eb8ce74def2 (diff)
Merge tag 'efi-2019-04-rc2' of https://github.com/xypron2/u-boot
The patches fix multiple errors. Mentionable are: - EFI unit tests (bootefi selftest) can run on i386. - `make tests` executes the Unicode unit tests. The LoadImage patch is preparing for further rework to be delivered in v2019.07.
Diffstat (limited to 'lib/efi_loader/efi_file.c')
-rw-r--r--lib/efi_loader/efi_file.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 4b4422205dd..3a7323765bd 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -641,6 +641,12 @@ static const struct efi_file_handle efi_file_handle_protocol = {
.flush = efi_file_flush,
};
+/**
+ * efi_file_from_path() - open file via device path
+ *
+ * @fp: device path
+ * @return: EFI_FILE_PROTOCOL for the file or NULL
+ */
struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp)
{
struct efi_simple_file_system_protocol *v;
@@ -655,10 +661,14 @@ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp)
if (ret != EFI_SUCCESS)
return NULL;
- /* skip over device-path nodes before the file path: */
+ /* Skip over device-path nodes before the file path. */
while (fp && !EFI_DP_TYPE(fp, MEDIA_DEVICE, FILE_PATH))
fp = efi_dp_next(fp);
+ /*
+ * Step through the nodes of the directory path until the actual file
+ * node is reached which is the final node in the device path.
+ */
while (fp) {
struct efi_device_path_file_path *fdp =
container_of(fp, struct efi_device_path_file_path, dp);