Skip to content

Commit

Permalink
fix: bug in block erase logic
Browse files Browse the repository at this point in the history
When figuring out the LBA for the current block we accidentally
used the partition offset and not the block size.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Tested-by: Jake Garver <[email protected]>
Reviewed-by: Jake Garver <[email protected]>
  • Loading branch information
gmahadevan authored and UEFI Builder committed Jan 15, 2025
1 parent b720a12 commit 17d1417
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Silicon/NVIDIA/Drivers/FvbNorFlashDxe/VarIntCheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ GetWriteOffset (
*Offset = BlockOffset;
break;
} else if (ReadBuf[0] == VAR_INT_VALID) {
ValidRecord = CurOffset;
ValidRecord = BlockOffset;
}

BlockOffset += This->MeasurementSize;
Expand All @@ -313,7 +313,7 @@ GetWriteOffset (
if ((ValidRecord == 0) || (NumPartitionBlocks == 1)) {
*Offset = This->PartitionByteOffset;
} else {
CurBlock = (ValidRecord / This->PartitionByteOffset);
CurBlock = (ValidRecord / This->BlockSize);
if (CurBlock == EndBlock) {
*Offset = This->PartitionByteOffset;
} else {
Expand Down

0 comments on commit 17d1417

Please sign in to comment.