From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] commands: avb_pvalue: fix print out of wrong arguments in error message
Date: Wed, 9 Apr 2025 11:47:41 +0200 [thread overview]
Message-ID: <20250409094740.2861331-1-a.fatoum@pengutronix.de> (raw)
read_varname is always NULL whenever write_varname is non-NULL.
Replace it by the correct string to indicate where the failure occurred.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
commands/avb_pvalue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands/avb_pvalue.c b/commands/avb_pvalue.c
index adc44321fb54..d91c311de5ec 100644
--- a/commands/avb_pvalue.c
+++ b/commands/avb_pvalue.c
@@ -55,7 +55,7 @@ static int do_avb_pvalue(int argc, char *argv[])
if (filename) {
ret = read_file_2(filename, &size, &buf, FILESIZE_MAX);
if (ret) {
- printf("Cannot read %s: %pe\n", read_varname, ERR_PTR(ret));
+ printf("Cannot read %s: %pe\n", filename, ERR_PTR(ret));
return COMMAND_ERROR;
}
} else {
@@ -67,7 +67,7 @@ static int do_avb_pvalue(int argc, char *argv[])
}
ret = avb_write_persistent_value(write_varname, size, buf);
if (ret) {
- printf("Cannot write variable %s: %pe\n", read_varname, ERR_PTR(ret));
+ printf("Cannot write variable %s: %pe\n", write_varname, ERR_PTR(ret));
goto err;
}
}
--
2.39.5
next reply other threads:[~2025-04-09 9:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 9:47 Ahmad Fatoum [this message]
2025-04-10 7:25 ` Sascha Hauer
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=20250409094740.2861331-1-a.fatoum@pengutronix.de \
--to=a.fatoum@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