[PATCH] PCI Hotplug: don't use acpi_os_free
[powerpc.git] / drivers / pci / hotplug / cpci_hotplug_core.c
index 8132d94..037ce4c 100644 (file)
@@ -217,6 +217,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
        kfree(slot->hotplug_slot->info);
        kfree(slot->hotplug_slot->name);
        kfree(slot->hotplug_slot);
+       if (slot->dev)
+               pci_dev_put(slot->dev);
        kfree(slot);
 }
 
@@ -246,22 +248,19 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
         * with the pci_hotplug subsystem.
         */
        for (i = first; i <= last; ++i) {
-               slot = kmalloc(sizeof (struct slot), GFP_KERNEL);
+               slot = kzalloc(sizeof (struct slot), GFP_KERNEL);
                if (!slot)
                        goto error;
-               memset(slot, 0, sizeof (struct slot));
 
                hotplug_slot =
-                   kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
+                       kzalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
                if (!hotplug_slot)
                        goto error_slot;
-               memset(hotplug_slot, 0, sizeof (struct hotplug_slot));
                slot->hotplug_slot = hotplug_slot;
 
-               info = kmalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL);
+               info = kzalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL);
                if (!info)
                        goto error_hpslot;
-               memset(info, 0, sizeof (struct hotplug_slot_info));
                hotplug_slot->info = info;
 
                name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);