]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
smbios: use struct_table_length to get SMBIOS 2.1 total table length
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Thu, 25 Jan 2024 01:11:28 +0000 (10:11 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 26 Jan 2024 13:16:46 +0000 (14:16 +0100)
The current code convert the SMBIOS 2.1 entry point structure to
SMBIOS 3.0 entry point structure. The max_struct_size member in
SMBIOS 2.1 entry point structure indicates
"Size of the largest SMBIOS structure, in bytes".
We need to use struct_table_length instead.

Fixes: 1c5aab803c0b ("smbios: copy QEMU tables")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/misc/qfw_smbios.c

index 9019345783ff027db4edb14de5e9a35419fc10d7..a898cb4eea4b928408436535b13f91fafe0602ad 100644 (file)
@@ -90,7 +90,7 @@ static int qfw_parse_smbios_anchor(struct udevice *dev,
                entry->length = sizeof(struct smbios3_entry);
                entry->major_ver = entry2->major_ver;
                entry->minor_ver = entry2->minor_ver;
-               entry->max_struct_size = entry2->max_struct_size;
+               entry->max_struct_size = entry2->struct_table_length;
        } else {
                ret = -ENOENT;
                goto out;