Skip to content

Commit bb3424a

Browse files
committed
fix: clean lint for pci ids (never negative)
Signed-off-by: Rajat Chopra <rajatc@nvidia.com>
1 parent 8a89113 commit bb3424a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/links/pciinfo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ type PciInfo nvml.PciInfo
3434
func (p PciInfo) BusID() string {
3535
var bytes []byte
3636
for _, b := range p.BusId {
37-
if byte(b) == '\x00' {
37+
if b >= 0 && byte(b) == '\x00' {
3838
break
3939
}
40+
// #nosec G115
4041
bytes = append(bytes, byte(b))
4142
}
4243
id := strings.ToLower(string(bytes))

0 commit comments

Comments
 (0)