From 857dcbbfe70d3fadcc08d85359246381e505257b Mon Sep 17 00:00:00 2001 From: mintsuki Date: Fri, 1 Jul 2022 18:32:18 +0200 Subject: [PATCH] part: Fix broken sector count normalisation calculation --- common/lib/part.s2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/part.s2.c b/common/lib/part.s2.c index 10c3e457..2bceb998 100644 --- a/common/lib/part.s2.c +++ b/common/lib/part.s2.c @@ -209,8 +209,8 @@ static int gpt_get_part(struct volume *ret, struct volume *volume, int partition ret->is_optical = volume->is_optical; ret->partition = partition + 1; ret->sector_size = volume->sector_size; - ret->first_sect = entry.starting_lba / (lb_size / 512); - ret->sect_count = ((entry.ending_lba - entry.starting_lba) + 1) / (lb_size / 512); + ret->first_sect = entry.starting_lba * (lb_size / 512); + ret->sect_count = ((entry.ending_lba - entry.starting_lba) + 1) * (lb_size / 512); ret->backing_dev = volume; struct guid guid;