xen/cpupool: Fold error paths in cpupool_create()

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>
This commit is contained in:
Andrew Cooper committed 2020-01-07 12:26:45 +00:00
1 parent 0dd9268808
commit c4f3fc12cd
1 file changed
+7 -8
+7 -8
View File
@@ -236,10 +236,8 @@ static struct cpupool *cpupool_create(
{
if ( (*q)->cpupool_id == poolid )
{
spin_unlock(&cpupool_lock);
free_cpupool_struct(c);
*perr = -EEXIST;
return NULL;
goto err;
}
c->next = *q;
}
@@ -253,11 +251,7 @@ static struct cpupool *cpupool_create(
{
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;
@@ -270,6 +264,11 @@ static struct cpupool *cpupool_create(
*perr = 0;
return c;
err:
spin_unlock(&cpupool_lock);
free_cpupool_struct(c);
return NULL;
}
/*
* destroys the given cpupool
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.