diff options
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/common/smbios.c | 6 | ||||
-rw-r--r-- | src/soc/intel/common/smbios.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/soc/intel/common/smbios.c b/src/soc/intel/common/smbios.c index 3aee9ff424..6c14ff0b67 100644 --- a/src/soc/intel/common/smbios.c +++ b/src/soc/intel/common/smbios.c @@ -20,7 +20,8 @@ /* Fill the SMBIOS memory information from FSP MEM_INFO_DATA_HOB in CBMEM.*/ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type, - u32 frequency, u8 channel_id, u8 dimm_id, const char *module_part_num, + u32 frequency, u8 channel_id, u8 dimm_id, + const char *module_part_num, size_t module_part_number_size, u16 data_width) { dimm->dimm_size = dimm_capacity; @@ -30,7 +31,8 @@ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type, dimm->dimm_num = dimm_id; strncpy((char *)dimm->module_part_number, module_part_num, - sizeof(dimm->module_part_number)); + min(sizeof(dimm->module_part_number), + module_part_number_size)); switch (data_width) { case 8: dimm->bus_width = MEMORY_BUS_WIDTH_8; diff --git a/src/soc/intel/common/smbios.h b/src/soc/intel/common/smbios.h index d38d6128c8..4750d3cd7d 100644 --- a/src/soc/intel/common/smbios.h +++ b/src/soc/intel/common/smbios.h @@ -21,7 +21,8 @@ /* Fill the SMBIOS memory information from FSP MEM_INFO_DATA_HOB in CBMEM.*/ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type, - u32 frequency, u8 channel_id, u8 dimm_id, const char *module_part_num, + u32 frequency, u8 channel_id, u8 dimm_id, + const char *module_part_num, size_t module_part_number_size, u16 data_width); #endif /* _COMMON_SMBIOS_H_ */ |