Skip to content

Commit

Permalink
PCI: Use kzalloc() in pci_create_bus()
Browse files Browse the repository at this point in the history
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Geert Uytterhoeven authored and Jesse Barnes committed Mar 20, 2009
1 parent 32a9a68 commit 6a3b3e2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
if (!b)
return NULL;

dev = kmalloc(sizeof(*dev), GFP_KERNEL);
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev){
kfree(b);
return NULL;
Expand All @@ -1133,7 +1133,6 @@ struct pci_bus * pci_create_bus(struct device *parent,
list_add_tail(&b->node, &pci_root_buses);
up_write(&pci_bus_sem);

memset(dev, 0, sizeof(*dev));
dev->parent = parent;
dev->release = pci_release_bus_bridge_dev;
dev_set_name(dev, "pci%04x:%02x", pci_domain_nr(b), bus);
Expand Down

0 comments on commit 6a3b3e2

Please sign in to comment.