Provided the condition in the if-clause is correct fix the off-by-one in calculating the maximum. Additionally print end_lba instead of start_lba. Signed-off-by: Ulrich Ölmann <u.oelmann@xxxxxxxxxxxxxx> --- common/partitions/efi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/partitions/efi.c b/common/partitions/efi.c index 6caa3919832c..b5b4d378e69b 100644 --- a/common/partitions/efi.c +++ b/common/partitions/efi.c @@ -651,8 +651,8 @@ static __maybe_unused int efi_partition_mkpart(struct partition_desc *pd, } if (end_lba >= last_lba(pd->blk) - 33) { - pr_err("invalid end LBA %lld, maximum is %lld\n", start_lba, - last_lba(pd->blk) - 33); + pr_err("invalid end LBA %lld, maximum is %lld\n", end_lba, + last_lba(pd->blk) - 34); return -EINVAL; } -- 2.39.5