summaryrefslogtreecommitdiffstats
path: root/common/partitions
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2014-11-10 09:44:00 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2014-11-11 15:02:23 +0100
commit84dc21e1853459d3d9cb0d53a13039eb128fad7d (patch)
tree5f6db0c685951ad7711d48f9516870708cfb558c /common/partitions
parent9a4cb25a39eb82c7f0c373f4e5186e195d6a318e (diff)
downloadbarebox-84dc21e1853459d3d9cb0d53a13039eb128fad7d.tar.gz
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 <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/partitions')
-rw-r--r--common/partitions/efi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index dcb9541..61abf00 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;
}
/**