diff options
| author | Tom Rini <[email protected]> | 2021-02-21 11:17:30 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-02-21 11:17:30 -0500 |
| commit | bbc0fcc302bab4521b1b87036c791ed2e8a33ea6 (patch) | |
| tree | 5e7c8664518cabfad154b857b67444ed1eda550a /lib/efi_loader | |
| parent | b732c8780c3f7b47b00bd59e5f6ad7d6ec099d68 (diff) | |
| parent | d46bee8c2d2494e5cff95d865845d497b4897787 (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')
| -rw-r--r-- | lib/efi_loader/efi_device_path_to_text.c | 17 | ||||
| -rw-r--r-- | lib/efi_loader/efi_disk.c | 4 |
2 files changed, 14 insertions, 7 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); diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 1f6b817dead..307d5d759b8 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -148,7 +148,7 @@ static efi_status_t EFIAPI efi_disk_read_blocks(struct efi_block_io *this, (uintptr_t)buffer & (this->media->io_align - 1)) return EFI_INVALID_PARAMETER; if (lba * this->media->block_size + buffer_size > - this->media->last_block * this->media->block_size) + (this->media->last_block + 1) * this->media->block_size) return EFI_INVALID_PARAMETER; #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER @@ -216,7 +216,7 @@ static efi_status_t EFIAPI efi_disk_write_blocks(struct efi_block_io *this, (uintptr_t)buffer & (this->media->io_align - 1)) return EFI_INVALID_PARAMETER; if (lba * this->media->block_size + buffer_size > - this->media->last_block * this->media->block_size) + (this->media->last_block + 1) * this->media->block_size) return EFI_INVALID_PARAMETER; #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER |
