From d6808a48d2dffd72f618fa372fba993736638799 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Jul 2005 18:16:03 +0000 Subject: [PATCH] Fix scanpci -v core dump when subsys vendor/device id's are NOVENDOR & NODEVICE. Bug #3763 Patch #3074 --- hw/xfree86/utils/scanpci/scanpci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/utils/scanpci/scanpci.c b/hw/xfree86/utils/scanpci/scanpci.c index 4ed4a1108..dac7d45af 100644 --- a/hw/xfree86/utils/scanpci/scanpci.c +++ b/hw/xfree86/utils/scanpci/scanpci.c @@ -216,7 +216,7 @@ identify_card(pciConfigPtr pcr, int verbose) int i, j; int foundit = 0; int foundvendor = 0; - const char *vname, *dname, *svname, *sname; + const char *vname = NULL, *dname = NULL, *svname = NULL, *sname = NULL; pciVendorDevFuncInfo *vdf = vendorDeviceFuncInfo; @@ -263,6 +263,8 @@ identify_card(pciConfigPtr pcr, int verbose) if (verbose && !(pcr->pci_header_type & 0x7f) && (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_device != pcr->pci_subsys_card)) { foundit = 0;