mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
Allow last block to be read
The last block is of size media->block_size Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer> Simplify expression. Apply same change to efi_disk_write_blocks(). Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
ea966d24ef
commit
e67beffee0
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue