patch-2.3.10 linux/drivers/pci/pci.c

Next file: linux/drivers/pnp/Config.in
Previous file: linux/drivers/pci/oldproc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.9/linux/drivers/pci/pci.c linux/drivers/pci/pci.c
@@ -138,7 +138,7 @@
 	}
 }
 
-__initfunc(void pci_read_bases(struct pci_dev *dev, unsigned int howmany))
+void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany)
 {
 	unsigned int reg;
 	u32 l;
@@ -166,7 +166,7 @@
 }
 
 
-__initfunc(unsigned int pci_scan_bus(struct pci_bus *bus))
+unsigned int __init pci_scan_bus(struct pci_bus *bus)
 {
 	unsigned int devfn, l, max, class;
 	unsigned char cmd, irq, tmp, hdr_type, is_multi = 0;
@@ -192,6 +192,11 @@
 			continue;
 
 		dev = kmalloc(sizeof(*dev), GFP_ATOMIC);
+		if(dev==NULL)
+		{
+			printk(KERN_ERR "pci: out of memory.\n");
+			continue;
+		}
 		memset(dev, 0, sizeof(*dev));
 		dev->bus = bus;
 		dev->devfn  = devfn;
@@ -300,6 +305,11 @@
 			 * Insert it into the tree of buses.
 			 */
 			child = kmalloc(sizeof(*child), GFP_ATOMIC);
+			if(child==NULL)
+			{
+				printk(KERN_ERR "pci: out of memory for bridge.\n");
+				continue;
+			}
 			memset(child, 0, sizeof(*child));
 			child->next = bus->children;
 			bus->children = child;
@@ -389,7 +399,7 @@
 	return b;
 }
 
-__initfunc(void pci_init(void))
+void __init pci_init(void)
 {
 	pcibios_init();
 
@@ -415,7 +425,7 @@
 #endif
 }
 
-__initfunc(void pci_setup (char *str, int *ints))
+void __init pci_setup (char *str, int *ints)
 {
 	while (str) {
 		char *k = strchr(str, ',');

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)