 dbg("%s\n",__FUNCTION__); 
static int init_slots(struct controller *ctrl){	struct slot *new_slot;	u8 number_of_slots;	u8 slot_device;	u32 slot_number;	int result = -ENOMEM;	dbg("%s\n",__FUNCTION__);	number_of_slots = ctrl->num_slots;	slot_device = ctrl->slot_device_offset;	slot_number = ctrl->first_slot;	while (number_of_slots) {		new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);		if (!new_slot)			goto error;		memset(new_slot, 0, sizeof(struct slot));		new_slot->hotplug_slot =				kmalloc(sizeof(*(new_slot->hotplug_slot)),						GFP_KERNEL);		if (!new_slot->hotplug_slot)			goto error_slot;		memset(new_slot->hotplug_slot, 0, sizeof(struct hotplug_slot));		new_slot->hotplug_slot->info =			kmalloc(sizeof(*(new_slot->hotplug_slot->info)),						GFP_KERNEL);		if (!new_slot->hotplug_slot->info)			goto error_hpslot;		memset(new_slot->hotplug_slot->info, 0,					sizeof(struct hotplug_slot_info));		new_slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE,						GFP_KERNEL);		if (!new_slot->hotplug_slot->name)			goto error_info;		new_slot->ctrl = ctrl;		new_slot->bus = ctrl->slot_bus;		new_slot->device = slot_device;		new_slot->hpc_ops = ctrl->hpc_ops;		new_slot->number = ctrl->first_slot;		new_slot->hp_slot = slot_device - ctrl->slot_device_offset;		/* register this slot with the hotplug pci core */		new_slot->hotplug_slot->private = new_slot;		new_slot->hotplug_slot->release = &release_slot;		make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);		new_slot->hotplug_slot->ops = &pciehp_hotplug_slot_ops;		new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status));		new_slot->hpc_ops->get_attention_status(new_slot, &(new_slot->hotplug_slot->info->attention_status));		new_slot->hpc_ops->get_latch_status(new_slot, &(new_slot->hotplug_slot->info->latch_status));		new_slot->hpc_ops->get_adapter_status(new_slot, &(new_slot->hotplug_slot->info->adapter_status));		dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x slot_device_offset=%x\n", 			new_slot->bus, new_slot->device, new_slot->hp_slot, new_slot->number, ctrl->slot_device_offset);		result = pci_hp_register (new_slot->hotplug_slot);		if (result) {			err ("pci_hp_register failed with error %d\n", result);			goto error_name;		}		new_slot->next = ctrl->slot;		ctrl->slot = new_slot;		number_of_slots--;		slot_device++;		slot_number += ctrl->slot_num_inc;	}	return 0;error_name:	kfree(new_slot->hotplug_slot->name);error_info:	kfree(new_slot->hotplug_slot->info);error_hpslot:	kfree(new_slot->hotplug_slot);error_slot:	kfree(new_slot);error:	return result;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1a9ed1bfe2fb17cc30227a12a3c1212128bb78b6/pciehp_core.c/clean/drivers/pci/hotplug/pciehp_core.c