[PATCH] uefi: esrt: fix the last_attempt_status wrongly interpretation of value
Ivan Hu
ivan.hu at canonical.com
Thu Aug 31 07:21:55 UTC 2023
BugLink: https://bugs.launchpad.net/fwts/+bug/2033596
checking the kernel drivers/firmware/efi/esrt.c, last_attempt_status value
should be decimal.
esre_attr_decl(last_attempt_status, 32, "%u");
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/uefi/esrt/esrt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/uefi/esrt/esrt.c b/src/uefi/esrt/esrt.c
index d3b1db85..cd2901eb 100644
--- a/src/uefi/esrt/esrt.c
+++ b/src/uefi/esrt/esrt.c
@@ -167,13 +167,13 @@ static void check_entries(fwts_framework *fw, bool *passed)
"Missing or failed to get LastAttemptStatus on %s.", entry->d_name);
*passed = false;
} else {
- uint32_t lastattemptst = strtoul(str, NULL, 16);
+ uint32_t lastattemptst = strtoul(str, NULL, 10);
if (lastattemptst > LAST_ATTEMPT_STATUS_ERR_UNSATISFIED_DEPENDENCIES &&
(lastattemptst < LAST_ATTEMPT_STATUS_ERR_UNSUCCESSFUL_VENDOR_RANGE_MIN ||
lastattemptst > LAST_ATTEMPT_STATUS_ERR_UNSUCCESSFUL_VENDOR_RANGE_MAX)) {
fwts_failed(fw, LOG_LEVEL_MEDIUM, "InvalidValue",
- "The LastAttemptStatus value on %s is 0x%" PRIx32
+ "The LastAttemptStatus value on %s is 0x%" PRIu32
", which is undefined on UEFI Spec."
, entry->d_name, lastattemptst);
*passed = false;
--
2.34.1
More information about the fwts-devel
mailing list