From dcaf8718e1e0e2292563f9d035e3d114cfdc1f0f Mon Sep 17 00:00:00 2001 From: Alex Chiang Date: Mon, 20 Oct 2008 17:41:43 -0600 Subject: [PATCH] --- yaml --- r: 117221 b: refs/heads/master c: b2132fecca02fa05d509ba4c8c1e51dee6ccd003 h: refs/heads/master i: 117219: 2251c635f959137a52660856fd4a43bd0b98fc28 v: v3 --- [refs] | 2 +- trunk/drivers/pci/hotplug/rpaphp_slot.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index a99e14d46240..366a0d8ae72d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1acb24f059defdaa0264e925f19cc21b0a3e592 +refs/heads/master: b2132fecca02fa05d509ba4c8c1e51dee6ccd003 diff --git a/trunk/drivers/pci/hotplug/rpaphp_slot.c b/trunk/drivers/pci/hotplug/rpaphp_slot.c index 736d3b43ed0b..2ea9cf1a8d02 100644 --- a/trunk/drivers/pci/hotplug/rpaphp_slot.c +++ b/trunk/drivers/pci/hotplug/rpaphp_slot.c @@ -43,7 +43,7 @@ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot) void dealloc_slot_struct(struct slot *slot) { kfree(slot->hotplug_slot->info); - kfree(slot->hotplug_slot->name); + kfree(slot->name); kfree(slot->hotplug_slot); kfree(slot); } @@ -63,11 +63,9 @@ struct slot *alloc_slot_struct(struct device_node *dn, GFP_KERNEL); if (!slot->hotplug_slot->info) goto error_hpslot; - slot->hotplug_slot->name = kmalloc(strlen(drc_name) + 1, GFP_KERNEL); - if (!slot->hotplug_slot->name) + slot->name = kstrdup(drc_name, GFP_KERNEL); + if (!slot->name) goto error_info; - slot->name = slot->hotplug_slot->name; - strcpy(slot->name, drc_name); slot->dn = dn; slot->index = drc_index; slot->power_domain = power_domain;