[PATCH 1/1] lib: Solve issue of loading SMBIOS table

Sunny Wang Sunny.Wang at arm.com
Wed Oct 20 16:01:57 UTC 2021


Tested on an ARM based server system. Thanks for fixing this, Edhaya.

Tested-by: Sunny Wang <sunny.wang at arm.com>

-----Original Message-----
From: G Edhaya Chandran <edhaya.chandran at arm.com>
Sent: 20 October 2021 15:30
To: fwts-devel at lists.ubuntu.com
Cc: colin.king at canonical.com; ivan.hu at canonical.com; alex.hung at canonical.com; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>; G Edhaya Chandran <Edhaya.Chandran at arm.com>; Sunny Wang <Sunny.Wang at arm.com>; Paul Yang <Paul.Yang at arm.com>
Subject: [PATCH 1/1] lib: Solve issue of loading SMBIOS table

In the case where SMBIOS table is loaded from
/sys/firmware/dmi/tables/smbios_entry_point,
the load fails due to a logical error in the if condition which is
solved below
The load fails with the below logs
dmicheck: Could not find any SMBIOS Table Entry Points.
dmicheck: Cannot find SMBIOS30 table entry.

The issue may have been introduced during the recent refactoring of the
code.

Signed-off-by: Edhaya Chandran <edhaya.chandran at arm.com>

---
 src/lib/src/fwts_smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
index 8da572e9..6402fad8 100644
--- a/src/lib/src/fwts_smbios.c
+++ b/src/lib/src/fwts_smbios.c
@@ -91,7 +91,7 @@ static void *fwts_smbios_find_entry_uefi(
                }

                if (fwts_load_file("/sys/firmware/dmi/tables/smbios_entry_point", entry, size) == FWTS_OK &&
-                   strncmp((char*)entry, sm, strlen(sm))) {
+                   !strncmp((char*)entry, sm, strlen(sm))) {
                        fwts_log_info(fw, "%s entry loaded from /sys/firmware/dmi/tables/smbios_entry_point\n", smbios);
                        *type  = FWTS_SMBIOS;
                        return addr;
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.



More information about the fwts-devel mailing list