aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/rpaphp_slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_slot.c')
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 78943e064b59..b771196a654e 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -84,19 +84,16 @@ struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_
84{ 84{
85 struct slot *slot; 85 struct slot *slot;
86 86
87 slot = kmalloc(sizeof (struct slot), GFP_KERNEL); 87 slot = kzalloc(sizeof(struct slot), GFP_KERNEL);
88 if (!slot) 88 if (!slot)
89 goto error_nomem; 89 goto error_nomem;
90 memset(slot, 0, sizeof (struct slot)); 90 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
91 slot->hotplug_slot = kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
92 if (!slot->hotplug_slot) 91 if (!slot->hotplug_slot)
93 goto error_slot; 92 goto error_slot;
94 memset(slot->hotplug_slot, 0, sizeof (struct hotplug_slot)); 93 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
95 slot->hotplug_slot->info = kmalloc(sizeof (struct hotplug_slot_info),
96 GFP_KERNEL); 94 GFP_KERNEL);
97 if (!slot->hotplug_slot->info) 95 if (!slot->hotplug_slot->info)
98 goto error_hpslot; 96 goto error_hpslot;
99 memset(slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
100 slot->hotplug_slot->name = kmalloc(BUS_ID_SIZE + 1, GFP_KERNEL); 97 slot->hotplug_slot->name = kmalloc(BUS_ID_SIZE + 1, GFP_KERNEL);
101 if (!slot->hotplug_slot->name) 98 if (!slot->hotplug_slot->name)
102 goto error_info; 99 goto error_info;