9
0
Fork 0

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>
This commit is contained in:
Andrey Smirnov 2014-11-10 09:44:00 -08:00 committed by Sascha Hauer
parent 9a4cb25a39
commit 84dc21e185
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
/**