[coreboot-gerrit] Patch set updated for coreboot: arch/x86/smbios: fix length calculation for SMBIOS type 17

Iru Cai (mytbk920423@gmail.com) gerrit at coreboot.org
Thu Mar 10 02:01:41 CET 2016


Iru Cai (mytbk920423 at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14008

-gerrit

commit e93cfebd1d65302851fccb65719ee124ddc8b89a
Author: Iru Cai <mytbk920423 at gmail.com>
Date:   Wed Mar 9 23:22:58 2016 +0800

    arch/x86/smbios: fix length calculation for SMBIOS type 17
    
    Different DIMM modules give different SMBIOS type 17 lengths, so we
    can't use `meminfo->dimm_cnt*len' for entry struct size, otherwise
    it'll give a wrong SMBIOS size when two or more different DIMMs are
    installed on the machine.
    
    Change-Id: I0e33853f6aa4b30da547eb433839a397d451a8cf
    Signed-off-by: Iru Cai <mytbk920423 at gmail.com>
---
 src/arch/x86/smbios.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 8c87635..f380057 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -473,6 +473,7 @@ static int smbios_write_type11(unsigned long *current, int *handle)
 static int smbios_write_type17(unsigned long *current, int *handle)
 {
 	int len = sizeof(struct smbios_type17);
+	int totallen = 0;
 	int i;
 
 	struct memory_info *meminfo;
@@ -486,8 +487,9 @@ static int smbios_write_type17(unsigned long *current, int *handle)
 		dimm = &meminfo->dimm[i];
 		len = create_smbios_type17_for_dimm(dimm, current, handle);
 		*current += len;
+		totallen += len;
 	}
-	return meminfo->dimm_cnt * len;
+	return totallen;
 }
 
 static int smbios_write_type32(unsigned long *current, int handle)



More information about the coreboot-gerrit mailing list