All of lore.kernel.org
 help / color / mirror / Atom feed
* Wrong check for last block in lib/efi_loader/efi_disk.c?
@ 2021-02-08 17:02 Jesper Schmitz Mouridsen
  0 siblings, 0 replies; only message in thread
From: Jesper Schmitz Mouridsen @ 2021-02-08 17:02 UTC (permalink / raw)
  To: u-boot

Hi

I was not able to read the last block of my sd card

(the gpt backup block) without the following

diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index d0aad0252a..ea9d763072 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -147,7 +147,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 * this->media->block_size + 
this->media->block_size)
 ??????????????? return EFI_INVALID_PARAMETER;

Is my math wrong or is my patch correct?

With the patch the my efiloader can read the gpt backup block correctly,

Thanks

/Jesper

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-08 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 17:02 Wrong check for last block in lib/efi_loader/efi_disk.c? Jesper Schmitz Mouridsen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.