From 0961a8be2d15e4888b04007f79aa23607a5bcc57 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 23 Mar 2009 18:20:38 +0100 Subject: [PATCH] pci: Check if configuration type is PCI_CFG_NONE Impact: prevent from grabbing configuration when PCI is PCI_CFG_NONE Signed-off-by: Sebastian Herbszt (herbszt@gmx.de) --- com32/lib/pci/scan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index f73853f..adfec59 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -443,6 +443,10 @@ struct pci_domain *pci_scan(void) cfgtype = pci_set_config_type(PCI_CFG_AUTO); dprintf("PCI configuration type %d\n", cfgtype); + + if (cfgtype == PCI_CFG_NONE) + return NULL; + dprintf("Scanning PCI Buses\n"); for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) { @@ -519,7 +523,10 @@ void gather_additional_pci_config(struct pci_domain *domain) unsigned int nbus, ndev, nfunc, maxfunc; pciaddr_t a; int cfgtype; + cfgtype = pci_set_config_type(PCI_CFG_AUTO); + if (cfgtype == PCI_CFG_NONE) + return; for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) { bus = NULL; -- 2.7.4