fix(host): out of range when list GPU devices (#15080)

This commit is contained in:
Zexi Li
2022-09-28 07:53:08 +08:00
committed by GitHub
parent a3297e71c2
commit 3fcd994743

View File

@@ -480,6 +480,10 @@ func (g *IOMMUGroup) ListDevices(groupNum, selfAddr, vendorId string) []*PCIDevi
if addr == selfAddr {
continue
}
if len(addr) < 5 {
log.Warningf("Invalid addr %q of %q iommu_group[%s], skip it", addr, selfAddr, groupNum)
continue
}
dev, _ := detectPCIDevByAddrWithoutIOMMUGroup(addr[5:])
if dev != nil {
if dev.VendorId == vendorId {