From: "Ulrich Ölmann" <u.oelmann@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] partitions: efi: fix error message in mkpart
Date: Tue, 11 Feb 2025 10:34:49 +0100 [thread overview]
Message-ID: <20250211093449.2226799-1-u.oelmann@pengutronix.de> (raw)
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
reply other threads:[~2025-02-11 9:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250211093449.2226799-1-u.oelmann@pengutronix.de \
--to=u.oelmann@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox