aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpqphp_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_core.c')
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 187a199da93..c8eaeb43fa5 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -611,7 +611,7 @@ static int ctrl_slot_setup(struct controller *ctrl,
611 u32 tempdword; 611 u32 tempdword;
612 char name[SLOT_NAME_SIZE]; 612 char name[SLOT_NAME_SIZE];
613 void __iomem *slot_entry= NULL; 613 void __iomem *slot_entry= NULL;
614 int result = -ENOMEM; 614 int result;
615 615
616 dbg("%s\n", __func__); 616 dbg("%s\n", __func__);
617 617
@@ -623,19 +623,25 @@ static int ctrl_slot_setup(struct controller *ctrl,
623 623
624 while (number_of_slots) { 624 while (number_of_slots) {
625 slot = kzalloc(sizeof(*slot), GFP_KERNEL); 625 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
626 if (!slot) 626 if (!slot) {
627 result = -ENOMEM;
627 goto error; 628 goto error;
629 }
628 630
629 slot->hotplug_slot = kzalloc(sizeof(*(slot->hotplug_slot)), 631 slot->hotplug_slot = kzalloc(sizeof(*(slot->hotplug_slot)),
630 GFP_KERNEL); 632 GFP_KERNEL);
631 if (!slot->hotplug_slot) 633 if (!slot->hotplug_slot) {
634 result = -ENOMEM;
632 goto error_slot; 635 goto error_slot;
636 }
633 hotplug_slot = slot->hotplug_slot; 637 hotplug_slot = slot->hotplug_slot;
634 638
635 hotplug_slot->info = kzalloc(sizeof(*(hotplug_slot->info)), 639 hotplug_slot->info = kzalloc(sizeof(*(hotplug_slot->info)),
636 GFP_KERNEL); 640 GFP_KERNEL);
637 if (!hotplug_slot->info) 641 if (!hotplug_slot->info) {
642 result = -ENOMEM;
638 goto error_hpslot; 643 goto error_hpslot;
644 }
639 hotplug_slot_info = hotplug_slot->info; 645 hotplug_slot_info = hotplug_slot->info;
640 646
641 slot->ctrl = ctrl; 647 slot->ctrl = ctrl;