Fix scanpci -v core dump when subsys vendor/device id's are NOVENDOR &

NODEVICE. Bug #3763 <https://bugs.freedesktop.org/show_bug.cgi?id=3763>
    Patch #3074 <https://bugs.freedesktop.org/attachment.cgi?id=3074>
This commit is contained in:
Alan Coopersmith 2005-07-12 18:16:03 +00:00
parent cda9c7b267
commit d6808a48d2

View File

@ -216,7 +216,7 @@ identify_card(pciConfigPtr pcr, int verbose)
int i, j; int i, j;
int foundit = 0; int foundit = 0;
int foundvendor = 0; int foundvendor = 0;
const char *vname, *dname, *svname, *sname; const char *vname = NULL, *dname = NULL, *svname = NULL, *sname = NULL;
pciVendorDevFuncInfo *vdf = vendorDeviceFuncInfo; pciVendorDevFuncInfo *vdf = vendorDeviceFuncInfo;
@ -263,6 +263,8 @@ identify_card(pciConfigPtr pcr, int verbose)
if (verbose && !(pcr->pci_header_type & 0x7f) && if (verbose && !(pcr->pci_header_type & 0x7f) &&
(pcr->pci_subsys_vendor != 0 || pcr->pci_subsys_card != 0) && (pcr->pci_subsys_vendor != 0 || pcr->pci_subsys_card != 0) &&
((pcr->pci_subsys_vendor != NOVENDOR)
|| (pcr->pci_subsys_card != NOSUBSYS)) &&
(pcr->pci_vendor != pcr->pci_subsys_vendor || (pcr->pci_vendor != pcr->pci_subsys_vendor ||
pcr->pci_device != pcr->pci_subsys_card)) { pcr->pci_device != pcr->pci_subsys_card)) {
foundit = 0; foundit = 0;