diff options
author | Prabhakar Pujeri <prabhakar.pujeri@dell.com> | 2020-10-13 11:10:34 +0530 |
---|---|---|
committer | Prabhakar Pujeri <prabhakar.pujeri@dell.com> | 2020-10-13 11:10:34 +0530 |
commit | 92853b621ff72e3ba87e0ed7675d2103d05b8d3c (patch) | |
tree | f6d0b3d95d0ace5ccf0cccc80a0c8ab6c41c8aa6 /dmidecode.c | |
parent | 85a05114311a78c493eeb6c9b664b22c0d1c2e35 (diff) | |
download | dmidecode-git-92853b621ff72e3ba87e0ed7675d2103d05b8d3c.tar.gz |
fix: Memory Technology <OUT OF SPEC> when slot is empty
According to SMBIOS spec 3.4.0 Table 75 – Memory Device (Type 17) structure if the size of the memory device is 0 then we should consider the slot is empty
Diffstat (limited to 'dmidecode.c')
-rw-r--r-- | dmidecode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dmidecode.c b/dmidecode.c index cf32821..cfdd2cb 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -2695,7 +2695,7 @@ static void dmi_memory_device_speed(const char *attr, u16 code) pr_attr(attr, "%u MT/s", code); } -static void dmi_memory_technology(u8 code) +static void dmi_memory_technology(u8 code, u16 size) { /* 7.18.6 */ static const char * const technology[] = { @@ -2707,7 +2707,9 @@ static void dmi_memory_technology(u8 code) "NVDIMM-P", "Intel Optane DC persistent memory" /* 0x07 */ }; - if (code >= 0x01 && code <= 0x07) + if ( size == 0) + pr_attr("Memory Technology", "No Module Installed"); + else if (code >= 0x01 && code <= 0x07) pr_attr("Memory Technology", "%s", technology[code - 0x01]); else pr_attr("Memory Technology", "%s", out_of_spec); @@ -4480,7 +4482,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) dmi_memory_voltage_value("Configured Voltage", WORD(data + 0x26)); if (h->length < 0x34) break; - dmi_memory_technology(data[0x28]); + dmi_memory_technology(data[0x28],WORD(data + 0x0C)); dmi_memory_operating_mode_capability(WORD(data + 0x29)); pr_attr("Firmware Version", "%s", dmi_string(h, data[0x2B])); |