]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
sched: fix freeing per-vcpu data in sched_move_domain()
authorJuergen Gross <jgross@suse.com>
Wed, 25 Sep 2019 13:52:53 +0000 (15:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Sep 2019 13:52:53 +0000 (15:52 +0200)
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>
xen/common/schedule.c

index fdeec10c3b27939087769ecb90a4af1f86c716dc..3fdfa59ef3735162c67c2ca6827029356c4a434a 100644 (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;