Skip to content

Commit

Permalink
Fix code scanning alert-Incorrect conversion between integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostloda committed Oct 14, 2024
1 parent 36ef4c4 commit ae97e1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/device-plugin/nvidiadevice/nvinternal/rm/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ func parseMigDeviceUUID(mig string) (string, int, int, error) {
return "", 0, 0, fmt.Errorf("unable to parse UUID as MIG device")
}

gi, err := strconv.Atoi(tokens[1])
gi, err := strconv.ParseInt(tokens[1], 10, 32)
if err != nil {
return "", 0, 0, fmt.Errorf("unable to parse UUID as MIG device")
}

ci, err := strconv.Atoi(tokens[2])
ci, err := strconv.ParseInt(tokens[2], 10, 32)
if err != nil {
return "", 0, 0, fmt.Errorf("unable to parse UUID as MIG device")
}

return tokens[0], gi, ci, nil
return tokens[0], int(gi), int(ci), nil
}

0 comments on commit ae97e1f

Please sign in to comment.