The compiler can't fold because of the write to *perr in the first hunk.
No functional change, but slightly better compiled code.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
{
if ( (*q)->cpupool_id == poolid )
{
- spin_unlock(&cpupool_lock);
- free_cpupool_struct(c);
*perr = -EEXIST;
- return NULL;
+ goto err;
}
c->next = *q;
}
{
c->sched = scheduler_alloc(sched_id, perr);
if ( c->sched == NULL )
- {
- spin_unlock(&cpupool_lock);
- free_cpupool_struct(c);
- return NULL;
- }
+ goto err;
}
c->gran = opt_sched_granularity;
*perr = 0;
return c;
+
+ err:
+ spin_unlock(&cpupool_lock);
+ free_cpupool_struct(c);
+ return NULL;
}
/*
* destroys the given cpupool