summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path_to_text.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-02-21 11:17:30 -0500
committerTom Rini <trini@konsulko.com>2021-02-21 11:17:30 -0500
commitbbc0fcc302bab4521b1b87036c791ed2e8a33ea6 (patch)
tree5e7c8664518cabfad154b857b67444ed1eda550a /lib/efi_loader/efi_device_path_to_text.c
parentb732c8780c3f7b47b00bd59e5f6ad7d6ec099d68 (diff)
parentd46bee8c2d2494e5cff95d865845d497b4897787 (diff)
Merge tag 'efi-2021-04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2021-04-rc3 Bug fixes: * Let EFI simple file protocol access last block of partition * Correct conversion of multi-part device paths in EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() Documentation: * booti and qfw man-pages
Diffstat (limited to 'lib/efi_loader/efi_device_path_to_text.c')
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index 1aaa9f94fa4..81b8ac23ba5 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -369,11 +369,18 @@ static uint16_t EFIAPI *efi_convert_device_path_to_text(
if (!device_path)
goto out;
- while (device_path &&
- str + MAX_NODE_LEN < buffer + MAX_PATH_LEN) {
- *str++ = '/';
- str = efi_convert_single_device_node_to_text(str, device_path);
- device_path = efi_dp_next(device_path);
+ while (device_path && str + MAX_NODE_LEN < buffer + MAX_PATH_LEN) {
+ if (device_path->type == DEVICE_PATH_TYPE_END) {
+ if (device_path->sub_type !=
+ DEVICE_PATH_SUB_TYPE_INSTANCE_END)
+ break;
+ *str++ = ',';
+ } else {
+ *str++ = '/';
+ str = efi_convert_single_device_node_to_text(
+ str, device_path);
+ }
+ *(u8 **)&device_path += device_path->length;
}
text = efi_str_to_u16(buffer);