aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/pci
diff options
context:
space:
mode:
authorjws@cairnwell.research <jws@cairnwell.research>2003-04-09 10:38:33 +0000
committerjws@cairnwell.research <jws@cairnwell.research>2003-04-09 10:38:33 +0000
commita4270c33588bff131d57fa7a1a4f316dd2ce7c7f (patch)
tree2bef81d85a549e7f5831b2faeed97557d52cd04f /xen/drivers/pci
parentac8f25b4e562c7b694be38454fa7cf8521fd1301 (diff)
downloadxen-a4270c33588bff131d57fa7a1a4f316dd2ce7c7f.tar.gz
xen-a4270c33588bff131d57fa7a1a4f316dd2ce7c7f.tar.bz2
xen-a4270c33588bff131d57fa7a1a4f316dd2ce7c7f.zip
bitkeeper revision 1.160.1.3 (3e93f829-ne467JH-6UdjBVdjZRCgw)
a few tricks to avoid memory problems. BUG remains: there is nothing to stop the kernel stack growing too big (i.e. to nearly 8k); if it does, it will overwrite the idle0_task task struct which it shares a page with. If you see a page fault in the scheduler (prev_task, next_task corrupted), suspect this bug.
Diffstat (limited to 'xen/drivers/pci')
-rw-r--r--xen/drivers/pci/pci.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index 134e3e2c83..87a64d7f82 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -1505,21 +1505,26 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
{
unsigned int devfn, max, pass;
struct list_head *ln;
- struct pci_dev *dev, dev0;
+ struct pci_dev *dev, *dev0;
DBG("Scanning bus %02x\n", bus->number);
max = bus->secondary;
/* Create a device template */
- memset(&dev0, 0, sizeof(dev0));
- dev0.bus = bus;
- dev0.sysdata = bus->sysdata;
+ dev0 = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+ if(!dev0) {
+ panic("Out of memory scanning PCI bus!\n");
+ }
+ memset(dev0, 0, sizeof(struct pci_dev));
+ dev0->bus = bus;
+ dev0->sysdata = bus->sysdata;
/* Go find them, Rover! */
for (devfn = 0; devfn < 0x100; devfn += 8) {
- dev0.devfn = devfn;
- pci_scan_slot(&dev0);
+ dev0->devfn = devfn;
+ pci_scan_slot(dev0);
}
+ kfree(dev0);
/*
* After performing arch-dependent fixup of the bus, look behind