diff options
| -rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 14 | ||||
| -rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 14 | ||||
| -rw-r--r-- | drivers/pci/hotplug/pcihp_skeleton.c | 14 | ||||
| -rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 14 |
4 files changed, 40 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 3fadf2f135e8..2b4c412f94c3 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c | |||
| @@ -225,7 +225,7 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last) | |||
| 225 | struct hotplug_slot *hotplug_slot; | 225 | struct hotplug_slot *hotplug_slot; |
| 226 | struct hotplug_slot_info *info; | 226 | struct hotplug_slot_info *info; |
| 227 | char name[SLOT_NAME_SIZE]; | 227 | char name[SLOT_NAME_SIZE]; |
| 228 | int status = -ENOMEM; | 228 | int status; |
| 229 | int i; | 229 | int i; |
| 230 | 230 | ||
| 231 | if (!(controller && bus)) | 231 | if (!(controller && bus)) |
| @@ -237,18 +237,24 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last) | |||
| 237 | */ | 237 | */ |
| 238 | for (i = first; i <= last; ++i) { | 238 | for (i = first; i <= last; ++i) { |
| 239 | slot = kzalloc(sizeof (struct slot), GFP_KERNEL); | 239 | slot = kzalloc(sizeof (struct slot), GFP_KERNEL); |
| 240 | if (!slot) | 240 | if (!slot) { |
| 241 | status = -ENOMEM; | ||
| 241 | goto error; | 242 | goto error; |
| 243 | } | ||
| 242 | 244 | ||
| 243 | hotplug_slot = | 245 | hotplug_slot = |
| 244 | kzalloc(sizeof (struct hotplug_slot), GFP_KERNEL); | 246 | kzalloc(sizeof (struct hotplug_slot), GFP_KERNEL); |
| 245 | if (!hotplug_slot) | 247 | if (!hotplug_slot) { |
| 248 | status = -ENOMEM; | ||
| 246 | goto error_slot; | 249 | goto error_slot; |
| 250 | } | ||
| 247 | slot->hotplug_slot = hotplug_slot; | 251 | slot->hotplug_slot = hotplug_slot; |
| 248 | 252 | ||
| 249 | info = kzalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL); | 253 | info = kzalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL); |
| 250 | if (!info) | 254 | if (!info) { |
| 255 | status = -ENOMEM; | ||
| 251 | goto error_hpslot; | 256 | goto error_hpslot; |
| 257 | } | ||
| 252 | hotplug_slot->info = info; | 258 | hotplug_slot->info = info; |
| 253 | 259 | ||
| 254 | slot->bus = bus; | 260 | slot->bus = bus; |
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 187a199da93c..c8eaeb43fa5d 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; |
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c index b20ceaaa31f4..1f00b937f721 100644 --- a/drivers/pci/hotplug/pcihp_skeleton.c +++ b/drivers/pci/hotplug/pcihp_skeleton.c | |||
| @@ -252,7 +252,7 @@ static int __init init_slots(void) | |||
| 252 | struct slot *slot; | 252 | struct slot *slot; |
| 253 | struct hotplug_slot *hotplug_slot; | 253 | struct hotplug_slot *hotplug_slot; |
| 254 | struct hotplug_slot_info *info; | 254 | struct hotplug_slot_info *info; |
| 255 | int retval = -ENOMEM; | 255 | int retval; |
| 256 | int i; | 256 | int i; |
| 257 | 257 | ||
| 258 | /* | 258 | /* |
| @@ -261,17 +261,23 @@ static int __init init_slots(void) | |||
| 261 | */ | 261 | */ |
| 262 | for (i = 0; i < num_slots; ++i) { | 262 | for (i = 0; i < num_slots; ++i) { |
| 263 | slot = kzalloc(sizeof(*slot), GFP_KERNEL); | 263 | slot = kzalloc(sizeof(*slot), GFP_KERNEL); |
| 264 | if (!slot) | 264 | if (!slot) { |
| 265 | retval = -ENOMEM; | ||
| 265 | goto error; | 266 | goto error; |
| 267 | } | ||
| 266 | 268 | ||
| 267 | hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); | 269 | hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); |
| 268 | if (!hotplug_slot) | 270 | if (!hotplug_slot) { |
| 271 | retval = -ENOMEM; | ||
| 269 | goto error_slot; | 272 | goto error_slot; |
| 273 | } | ||
| 270 | slot->hotplug_slot = hotplug_slot; | 274 | slot->hotplug_slot = hotplug_slot; |
| 271 | 275 | ||
| 272 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 276 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
| 273 | if (!info) | 277 | if (!info) { |
| 278 | retval = -ENOMEM; | ||
| 274 | goto error_hpslot; | 279 | goto error_hpslot; |
| 280 | } | ||
| 275 | hotplug_slot->info = info; | 281 | hotplug_slot->info = info; |
| 276 | 282 | ||
| 277 | slot->number = i; | 283 | slot->number = i; |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 7414fd9ad1d2..b6de307248e4 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
| @@ -99,22 +99,28 @@ static int init_slots(struct controller *ctrl) | |||
| 99 | struct hotplug_slot *hotplug_slot; | 99 | struct hotplug_slot *hotplug_slot; |
| 100 | struct hotplug_slot_info *info; | 100 | struct hotplug_slot_info *info; |
| 101 | char name[SLOT_NAME_SIZE]; | 101 | char name[SLOT_NAME_SIZE]; |
| 102 | int retval = -ENOMEM; | 102 | int retval; |
| 103 | int i; | 103 | int i; |
| 104 | 104 | ||
| 105 | for (i = 0; i < ctrl->num_slots; i++) { | 105 | for (i = 0; i < ctrl->num_slots; i++) { |
| 106 | slot = kzalloc(sizeof(*slot), GFP_KERNEL); | 106 | slot = kzalloc(sizeof(*slot), GFP_KERNEL); |
| 107 | if (!slot) | 107 | if (!slot) { |
| 108 | retval = -ENOMEM; | ||
| 108 | goto error; | 109 | goto error; |
| 110 | } | ||
| 109 | 111 | ||
| 110 | hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); | 112 | hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); |
| 111 | if (!hotplug_slot) | 113 | if (!hotplug_slot) { |
| 114 | retval = -ENOMEM; | ||
| 112 | goto error_slot; | 115 | goto error_slot; |
| 116 | } | ||
| 113 | slot->hotplug_slot = hotplug_slot; | 117 | slot->hotplug_slot = hotplug_slot; |
| 114 | 118 | ||
| 115 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 119 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
| 116 | if (!info) | 120 | if (!info) { |
| 121 | retval = -ENOMEM; | ||
| 117 | goto error_hpslot; | 122 | goto error_hpslot; |
| 123 | } | ||
| 118 | hotplug_slot->info = info; | 124 | hotplug_slot->info = info; |
| 119 | 125 | ||
| 120 | slot->hp_slot = i; | 126 | slot->hp_slot = i; |
