diff options
Diffstat (limited to 'drivers/pci/hotplug/fakephp.c')
| -rw-r--r-- | drivers/pci/hotplug/fakephp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 060d74775d7b..71b80c23e8ce 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
| @@ -95,15 +95,13 @@ static int add_slot(struct pci_dev *dev) | |||
| 95 | struct hotplug_slot *slot; | 95 | struct hotplug_slot *slot; |
| 96 | int retval = -ENOMEM; | 96 | int retval = -ENOMEM; |
| 97 | 97 | ||
| 98 | slot = kmalloc(sizeof(struct hotplug_slot), GFP_KERNEL); | 98 | slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); |
| 99 | if (!slot) | 99 | if (!slot) |
| 100 | goto error; | 100 | goto error; |
| 101 | memset(slot, 0, sizeof(*slot)); | ||
| 102 | 101 | ||
| 103 | slot->info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); | 102 | slot->info = kzalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); |
| 104 | if (!slot->info) | 103 | if (!slot->info) |
| 105 | goto error_slot; | 104 | goto error_slot; |
| 106 | memset(slot->info, 0, sizeof(struct hotplug_slot_info)); | ||
| 107 | 105 | ||
| 108 | slot->info->power_status = 1; | 106 | slot->info->power_status = 1; |
| 109 | slot->info->max_bus_speed = PCI_SPEED_UNKNOWN; | 107 | slot->info->max_bus_speed = PCI_SPEED_UNKNOWN; |
| @@ -227,11 +225,10 @@ static void pci_rescan_bus(const struct pci_bus *bus) | |||
| 227 | { | 225 | { |
| 228 | unsigned int devfn; | 226 | unsigned int devfn; |
| 229 | struct pci_dev *dev; | 227 | struct pci_dev *dev; |
| 230 | dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); | 228 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); |
| 231 | if (!dev) | 229 | if (!dev) |
| 232 | return; | 230 | return; |
| 233 | 231 | ||
| 234 | memset(dev, 0, sizeof(dev)); | ||
| 235 | dev->bus = (struct pci_bus*)bus; | 232 | dev->bus = (struct pci_bus*)bus; |
| 236 | dev->sysdata = bus->sysdata; | 233 | dev->sysdata = bus->sysdata; |
| 237 | for (devfn = 0; devfn < 0x100; devfn += 8) { | 234 | for (devfn = 0; devfn < 0x100; devfn += 8) { |
