aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-14 09:48:26 -0500
committerTom Rini <trini@konsulko.com>2019-11-14 09:51:39 -0500
commit14b254b5f5a841e1227e3667cf94fbcdadaf720e (patch)
tree644eb1e21e312831970bbd682bd2fa3a6378e5c1 /lib/efi_loader/efi_device_path.c
parentcffda7ddb84e4b1d99777f362410cedf058108f0 (diff)
parent2e716b8e299309139daa9513707951c622fc2bdf (diff)
Merge tag 'efi-2020-01-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-01-rc3 The following changes for the UEFI subsystem are provided: * allow building UEFI binaries on the sandbox * enable access to file systems without partition tables * correctly check the return value of efi_dp_from_file()
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r--lib/efi_loader/efi_device_path.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index ac5e6f7e14..17a0c5bb45 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -1032,6 +1032,16 @@ out:
return EFI_SUCCESS;
}
+/**
+ * efi_dp_from_name() - convert U-Boot device and file path to device path
+ *
+ * @dev: U-Boot device, e.g. 'mmc'
+ * @devnr: U-Boot device number, e.g. 1 for 'mmc:1'
+ * @path: file path relative to U-Boot device, may be NULL
+ * @device: pointer to receive device path of the device
+ * @file: pointer to receive device path for the file
+ * Return: status code
+ */
efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
const char *path,
struct efi_device_path **device,
@@ -1071,10 +1081,9 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
s = filename;
while ((s = strchr(s, '/')))
*s++ = '\\';
- *file = efi_dp_from_file(((!is_net && device) ? desc : NULL),
- part, filename);
+ *file = efi_dp_from_file(is_net ? NULL : desc, part, filename);
- if (!file)
+ if (!*file)
return EFI_INVALID_PARAMETER;
return EFI_SUCCESS;