diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-07-16 09:29:01 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-07-16 09:29:01 -0600 |
commit | d47557e4616904c9208e233b2a0e11662ba293b1 (patch) | |
tree | 168fb2d022cf8e2c9bb456a0d1e53ab48937ebe6 /drivers/pci/hotplug/pcihp_skeleton.c | |
parent | 8d20e2cfeb4a098a4dd0bd637c5ea93aa9e84983 (diff) | |
parent | 83d057107382b74a4b15c59971631aa3542599a5 (diff) |
Merge branch 'pci/julia-return-values' into next
* pci/julia-return-values:
PCI: hotplug: ensure a consistent return value in error case
Diffstat (limited to 'drivers/pci/hotplug/pcihp_skeleton.c')
-rw-r--r-- | drivers/pci/hotplug/pcihp_skeleton.c | 14 |
1 files changed, 10 insertions, 4 deletions
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) struct slot *slot; struct hotplug_slot *hotplug_slot; struct hotplug_slot_info *info; - int retval = -ENOMEM; + int retval; int i; /* @@ -261,17 +261,23 @@ static int __init init_slots(void) */ for (i = 0; i < num_slots; ++i) { slot = kzalloc(sizeof(*slot), GFP_KERNEL); - if (!slot) + if (!slot) { + retval = -ENOMEM; goto error; + } hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); - if (!hotplug_slot) + if (!hotplug_slot) { + retval = -ENOMEM; goto error_slot; + } slot->hotplug_slot = hotplug_slot; info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) + if (!info) { + retval = -ENOMEM; goto error_hpslot; + } hotplug_slot->info = info; slot->number = i; |