lkml.org 
[lkml]   [2008]   [Oct]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 6 Oct 2008 09:44:33 +0300
From"Pekka Enberg" <>
SubjectRe: [PATCH v4 11/15] PCI: rpaphp: kmalloc/kfree slot->name directly
On Sat, Oct 4, 2008 at 2:18 AM, Alex Chiang <achiang@hp.com> wrote:
> @@ -63,10 +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 = kmalloc(strlen(drc_name) + 1, GFP_KERNEL);
> +       if (!slot->name)
>                goto error_info;
> -       slot->name = slot->hotplug_slot->name;
>        strcpy(slot->name, drc_name);

Minor nit: you could use kstrdup() here.


\
 
 \ /
  Last update: 2008-10-06 08:47    [from the cache]
©2003-2008