diff options
Diffstat (limited to 'drivers/pci/hotplug/cpci_hotplug_core.c')
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 3fadf2f135e..2b4c412f94c 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; |