sched: fix freeing per-vcpu data in sched_move_domain()
authorJuergen Gross <jgross@suse.com>
Fri, 25 Oct 2019 09:57:24 +0000 (11:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 09:57:24 +0000 (11:57 +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>
master commit: b6656e6aa4dd5de537ce07ec16bfbbbb538b28b5
master date: 2019-09-25 15:52:53 +0200

xen/common/schedule.c

index 049f93f7aab9a28f93e0f72396021b39bacdce28..dd167cce76db9162d30262f3fda9c1c7868ea9a5 100644 (file)
@@ -337,7 +337,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_OP(c->sched, free_vdata, vcpu_priv[v->vcpu_id]);
             xfree(vcpu_priv);
             sched_free_domdata(c->sched, domdata);
             return -ENOMEM;