diff --git a/dmidecode.c b/dmidecode.c
index a3e9d6c..2c4ae67 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -4114,13 +4114,13 @@ static void dmi_decode(const struct dmi_header *h, u16 ver)
 			printf("\tLocation: %s\n",
 				dmi_cache_location((WORD(data + 0x05) >> 5) & 0x0003));
 			printf("\tInstalled Size:");
-			if (h->length >= 0x1B)
+			if (h->length >= 0x1B && 0xFFFF==WORD(data + 0x09))
 				dmi_cache_size_2(DWORD(data + 0x17));
 			else
 				dmi_cache_size(WORD(data + 0x09));
 			printf("\n");
 			printf("\tMaximum Size:");
-			if (h->length >= 0x17)
+			if (h->length >= 0x17 && 0xFFFF==WORD(data + 0x07)) 
 				dmi_cache_size_2(DWORD(data + 0x13));
 			else
 				dmi_cache_size(WORD(data + 0x07));
