diff --git a/pkg/core/core.go b/pkg/core/core.go index 5fcfbbe5..755bffe5 100644 --- a/pkg/core/core.go +++ b/pkg/core/core.go @@ -75,7 +75,17 @@ func GetComID(d DriveIntf) (ComID, error) { c := binary.BigEndian.Uint16(comID[0:2]) ce := binary.BigEndian.Uint16(comID[2:4]) - return ComID(uint32(c) + uint32(ce)<<16), nil + ret := ComID(uint32(c) + uint32(ce)<<16) + + ok, err := IsComIDValid(d, ret) + if err != nil { + return 0, err + } + if !ok { + return 0, fmt.Errorf("failed to obtain valid ComID") + } + + return ret, nil } func HandleComIDRequest(d DriveIntf, comID ComID, req ComIDRequest) ([]byte, error) {