} 
cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last){	struct slot *slot;	struct hotplug_slot *hotplug_slot;	struct hotplug_slot_info *info;	char *name;	int status = -ENOMEM;	int i;	if(!(controller && bus)) {		return -ENODEV;	}	/*	 * Create a structure for each slot, and register that slot	 * with the pci_hotplug subsystem.	 */	for (i = first; i <= last; ++i) {		slot = kmalloc(sizeof (struct slot), GFP_KERNEL);		if (!slot)			goto error;		memset(slot, 0, sizeof (struct slot));		hotplug_slot =		    kmalloc(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);		if (!info)			goto error_hpslot;		memset(info, 0, sizeof (struct hotplug_slot_info));		hotplug_slot->info = info;		name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);		if (!name)			goto error_info;		hotplug_slot->name = name;		slot->bus = bus;		slot->number = i;		slot->devfn = PCI_DEVFN(i, 0);		hotplug_slot->private = slot;		hotplug_slot->release = &release_slot;		make_slot_name(slot);		hotplug_slot->ops = &cpci_hotplug_slot_ops;		/*		 * Initialize the slot info structure with some known		 * good values.		 */		dbg("initializing slot %s", slot->hotplug_slot->name);		info->power_status = cpci_get_power_status(slot);		info->attention_status = cpci_get_attention_status(slot);		dbg("registering slot %s", slot->hotplug_slot->name);		status = pci_hp_register(slot->hotplug_slot);		if (status) {			err("pci_hp_register failed with error %d", status);			goto error_name;		}		/* Add slot to our internal list */		down_write(&list_rwsem);		list_add(&slot->slot_list, &slot_list);		slots++;		up_write(&list_rwsem);	}	return 0;error_name:	kfree(name);error_info:	kfree(info);error_hpslot:	kfree(hotplug_slot);error_slot:	kfree(slot);error:	return status;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/bcc488ab02254a6e60d749187a632dc3d642d4f8/cpci_hotplug_core.c/buggy/drivers/pci/hotplug/cpci_hotplug_core.c