From: Juergen Gross Date: Wed, 25 Sep 2019 13:52:53 +0000 (+0200) Subject: sched: fix freeing per-vcpu data in sched_move_domain() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b6656e6aa4dd5de537ce07ec16bfbbbb538b28b5;p=people%2Fiwj%2Fxen.git 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 Reviewed-by: Jan Beulich Reviewed-by: Dario Faggioli --- diff --git a/xen/common/schedule.c b/xen/common/schedule.c index fdeec10c3b..3fdfa59ef3 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -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;