mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] partitions: efi: fix error message in mkpart
@ 2025-02-11  9:34 Ulrich Ölmann
  0 siblings, 0 replies; only message in thread
From: Ulrich Ölmann @ 2025-02-11  9:34 UTC (permalink / raw)
  To: Barebox List

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@pengutronix.de>
---
 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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-11  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-11  9:34 [PATCH] partitions: efi: fix error message in mkpart Ulrich Ölmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox