sched: fix freeing per-vcpu data in sched_move_domain()

In case of an allocation error of per-vcpu data in sched_move_domain()
the already allocated data is freed just using xfree(). This is wrong
as some schedulers need to do additional operations (e.g. the arinc653
scheduler needs to remove the vcpu-data from a list).

So instead xfree() make use of the sched_free_vdata() hook.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2019-09-25 15:52:53 +02:00
1 parent 4f54473d00
commit b6656e6aa4
1 file changed
+1 -1
+1 -1
View File
@@ -385,7 +385,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
if ( vcpu_priv[v->vcpu_id] == NULL )
{
for_each_vcpu ( d, v )
xfree(vcpu_priv[v->vcpu_id]);
sched_free_vdata(c->sched, vcpu_priv[v->vcpu_id]);
xfree(vcpu_priv);
sched_free_domdata(c->sched, domdata);
return -ENOMEM;
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.