[PATCH] dmicheck: skip type 17 test if no memory module

Alex Hung alex.hung at canonical.com
Tue Dec 17 11:48:06 UTC 2019


Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/dmi/dmicheck/dmicheck.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index d6220ed7..38f7f25c 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -1606,6 +1606,10 @@ static void dmicheck_entry(fwts_framework *fw,
 
 		case 17: /* 7.18 */
 			table = "Memory Device (Type 17)";
+
+			/* skip if memory module is not installed (size = 0) */
+			if (GET_UINT16(data + 0xc) == 0)
+				break;
 			if (hdr->length < 0x15)
 				break;
 			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0xf);
-- 
2.17.1




More information about the fwts-devel mailing list