[PATCH] lib: fwts_smbios: fix loading SMBIOS table from uefi

Sunny Wang Sunny.Wang at arm.com
Wed Oct 27 14:44:26 UTC 2021


Looks good. Tested on an ARM based server system. Thanks to Edhaya and Alex. 😊

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

-----Original Message-----
From: fwts-devel <fwts-devel-bounces at lists.ubuntu.com> On Behalf Of Alex Hung
Sent: 22 October 2021 18:19
To: fwts-devel at lists.ubuntu.com
Cc: G Edhaya Chandran <Edhaya.Chandran at arm.com>
Subject: [PATCH] lib: fwts_smbios: fix loading SMBIOS table from uefi

From: G Edhaya Chandran <edhaya.chandran at arm.com>

Buglink: https://bugs.launchpad.net/bugs/1947956

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.

Fixes: 8ce006f4ada ("lib: fwts_smbios: merge similar functions")
Signed-off-by: Edhaya Chandran <edhaya.chandran at arm.com>
Signed-off-by: Alex Hung <alex.hung at canonical.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.33.1


--
fwts-devel mailing list
fwts-devel at lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
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