lkml.org 
[lkml]   [2012]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 2/5] smpboot: Provide infrastructure for percpu hotplug threads
On Wed, Jun 13, 2012 at 11:00:54AM -0000, Thomas Gleixner wrote:
> +
> +static int
> +__smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu)
> +{
> + struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu);
> + struct smpboot_thread_data *td;
> +
> + if (tsk)
> + return 0;
> +
> + td = kzalloc_node(sizeof(*td), GFP_KERNEL, cpu_to_node(cpu));
> + if (!td)
> + return -ENOMEM;
> + td->cpu = cpu;
> + td->ht = ht;
> +
> + tsk = kthread_create_on_cpu(ht->thread_fn, td, cpu, ht->thread_comm);
> + if (IS_ERR(tsk))
> + return PTR_ERR(tsk);
> +
Hi Thomas, I might be missing something obvious but will not we leak td
allocated here if kthread_create_on_cpu failed?

Cyrill


\
 
 \ /
  Last update: 2012-06-18 11:42    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site