fix(baremetal): skip 'Volatile Size' line when detecting memory size

This commit is contained in:
Zexi Li
2023-06-13 13:14:22 +08:00
parent e6a4361c92
commit d61e97307c
+4
View File
@@ -162,6 +162,10 @@ func ParseDMIMemInfo(lines []string) *types.SDMIMemInfo {
if val == nil {
continue
}
// skip 'Volatile Size:' line
if strings.Contains(line, "Volatile") {
continue
}
value := strings.ToLower(*val)
if strings.HasSuffix(value, " mb") {
sizeMb, err := strconv.Atoi(strings.TrimSuffix(value, " mb"))