From 84dc21e1853459d3d9cb0d53a13039eb128fad7d Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 10 Nov 2014 09:44:00 -0800 Subject: partitions/efi: Fix off-by-one error in 'last_lba' LBAs are numbered starting from zero so the last LBA # would be equal to total number of blocks minus one. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- common/partitions/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/partitions') diff --git a/common/partitions/efi.c b/common/partitions/efi.c index dcb95414f6..61abf00050 100644 --- a/common/partitions/efi.c +++ b/common/partitions/efi.c @@ -55,7 +55,7 @@ static u64 last_lba(struct block_device *bdev) { if (!bdev) return 0; - return bdev->num_blocks; + return bdev->num_blocks - 1; } /** -- cgit v1.2.3