summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/spd_tools/ddr4/gen_spd.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/spd_tools/ddr4/gen_spd.go b/util/spd_tools/ddr4/gen_spd.go
index 831cddf824..e99239acd2 100644
--- a/util/spd_tools/ddr4/gen_spd.go
+++ b/util/spd_tools/ddr4/gen_spd.go
@@ -1068,7 +1068,14 @@ func verifySupportedCASLatencies(part *memPart) error {
}
func validateMemoryParts(memParts *memParts) error {
+ memPartExists := make(map[string]bool)
+
for i := 0; i < len(memParts.MemParts); i++ {
+ if memPartExists[memParts.MemParts[i].Name] {
+ return fmt.Errorf(memParts.MemParts[i].Name + " is duplicated in mem_parts_list_json")
+ }
+ memPartExists[memParts.MemParts[i].Name] = true
+
if err := validateSpeedMTps(memParts.MemParts[i].Attribs.SpeedMTps); err != nil {
return err
}