diff options
| -rw-r--r-- | drivers/pci/hotplug/rpaphp_slot.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 736d3b43ed0b..2ea9cf1a8d02 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c | |||
| @@ -43,7 +43,7 @@ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot) | |||
| 43 | void dealloc_slot_struct(struct slot *slot) | 43 | void dealloc_slot_struct(struct slot *slot) |
| 44 | { | 44 | { |
| 45 | kfree(slot->hotplug_slot->info); | 45 | kfree(slot->hotplug_slot->info); |
| 46 | kfree(slot->hotplug_slot->name); | 46 | kfree(slot->name); |
| 47 | kfree(slot->hotplug_slot); | 47 | kfree(slot->hotplug_slot); |
| 48 | kfree(slot); | 48 | kfree(slot); |
| 49 | } | 49 | } |
| @@ -63,11 +63,9 @@ struct slot *alloc_slot_struct(struct device_node *dn, | |||
| 63 | GFP_KERNEL); | 63 | GFP_KERNEL); |
| 64 | if (!slot->hotplug_slot->info) | 64 | if (!slot->hotplug_slot->info) |
| 65 | goto error_hpslot; | 65 | goto error_hpslot; |
| 66 | slot->hotplug_slot->name = kmalloc(strlen(drc_name) + 1, GFP_KERNEL); | 66 | slot->name = kstrdup(drc_name, GFP_KERNEL); |
| 67 | if (!slot->hotplug_slot->name) | 67 | if (!slot->name) |
| 68 | goto error_info; | 68 | goto error_info; |
| 69 | slot->name = slot->hotplug_slot->name; | ||
| 70 | strcpy(slot->name, drc_name); | ||
| 71 | slot->dn = dn; | 69 | slot->dn = dn; |
| 72 | slot->index = drc_index; | 70 | slot->index = drc_index; |
| 73 | slot->power_domain = power_domain; | 71 | slot->power_domain = power_domain; |
