Commit 73625a30 authored by Pablo Menichini's avatar Pablo Menichini Committed by Linus Torvalds

[PATCH] Handle kmalloc fails: drivers_pci_probe.c

parent f9cc7a83
......@@ -558,9 +558,15 @@ struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent,
b = pci_alloc_bus();
if (!b)
return NULL;
b->dev = kmalloc(sizeof(*(b->dev)),GFP_KERNEL);
if (!b->dev){
kfree(b);
return NULL;
}
list_add_tail(&b->node, &pci_root_buses);
b->dev = kmalloc(sizeof(*(b->dev)),GFP_KERNEL);
memset(b->dev,0,sizeof(*(b->dev)));
sprintf(b->dev->bus_id,"pci%d",bus);
strcpy(b->dev->name,"Host/PCI Bridge");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment