diff mbox series

uefi: esrt: fix the last_attempt_status wrongly interpretation of value

Message ID 20230831072155.29313-1-ivan.hu@canonical.com
State Accepted
Headers show
Series uefi: esrt: fix the last_attempt_status wrongly interpretation of value | expand

Commit Message

ivanhu Aug. 31, 2023, 7:21 a.m. UTC
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@canonical.com>
---
 src/uefi/esrt/esrt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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;