[PATCH] commands: avb_pvalue: fix print out of wrong arguments in error message
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Apr 9 02:47:41 PDT 2025
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 at 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
More information about the barebox
mailing list