Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157338615
D33059.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33059.id.diff
View Options
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -683,11 +683,12 @@
uint16_t vid, did;
vid = REG(PCIR_VENDOR, 2);
+ if (vid == PCIV_INVALID)
+ return (NULL);
+
did = REG(PCIR_DEVICE, 2);
- if (vid != 0xffff)
- return (pci_fill_devinfo(pcib, bus, d, b, s, f, vid, did));
- return (NULL);
+ return (pci_fill_devinfo(pcib, bus, d, b, s, f, vid, did));
}
struct pci_devinfo *
@@ -4141,6 +4142,10 @@
pcifunchigh = 0;
f = 0;
DELAY(1);
+
+ /* If function 0 is not present, skip to the next slot. */
+ if (REG(PCIR_VENDOR, 2) == PCIV_INVALID)
+ continue;
hdrtype = REG(PCIR_HDRTYPE, 1);
if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
continue;
@@ -4182,7 +4187,7 @@
for (s = 0; s <= maxslots; s++) {
/* If function 0 is not present, skip to the next slot. */
f = 0;
- if (REG(PCIR_VENDOR, 2) == 0xffff)
+ if (REG(PCIR_VENDOR, 2) == PCIV_INVALID)
continue;
pcifunchigh = 0;
hdrtype = REG(PCIR_HDRTYPE, 1);
@@ -4191,7 +4196,7 @@
if (hdrtype & PCIM_MFDEV)
pcifunchigh = PCIB_MAXFUNCS(pcib);
for (f = 0; f <= pcifunchigh; f++) {
- if (REG(PCIR_VENDOR, 2) == 0xffff)
+ if (REG(PCIR_VENDOR, 2) == PCIV_INVALID)
continue;
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 21, 11:05 AM (16 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33358828
Default Alt Text
D33059.id.diff (1 KB)
Attached To
Mode
D33059: pci: Don't try to read cfg registers of non-existing devices
Attached
Detach File
Event Timeline
Log In to Comment