Skip to content

Commit df83e1b

Browse files
committed
fpga: fix codeql issues
Signed-off-by: Tuomas Katila <[email protected]>
1 parent a0bc682 commit df83e1b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/fpga/dfl_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (f *DflFME) GetPortsNum() int {
236236
}
237237

238238
n, err := strconv.ParseUint(f.PortsNum, 10, 32)
239-
if err != nil || n >= math.MaxInt {
239+
if err != nil || n > math.MaxInt32 {
240240
return -1
241241
}
242242

pkg/fpga/intel_fpga_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (f *IntelFpgaFME) GetPortsNum() int {
241241
}
242242

243243
n, err := strconv.ParseUint(f.PortsNum, 10, 32)
244-
if err != nil || n >= math.MaxInt {
244+
if err != nil || n > math.MaxInt32 {
245245
return -1
246246
}
247247

0 commit comments

Comments
 (0)