sched: fix sched_move_domain() for domain without vcpus
authorJuergen Gross <jgross@suse.com>
Wed, 15 Sep 2021 08:57:47 +0000 (10:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 15 Sep 2021 08:57:47 +0000 (10:57 +0200)
commit999e1582f289cfb8d59e2e58927c1cba0ac2ada3
treeea0c92c5861b078ecf2e8046351729951e80c2d3
parent487975df53b5298316b594550c79934d646701bd
sched: fix sched_move_domain() for domain without vcpus

In case a domain is created with a cpupool other than Pool-0 specified
it will be moved to that cpupool before any vcpus are allocated.

This will lead to a NULL pointer dereference in sched_move_domain().

Fix that by tolerating vcpus not being allocated yet.

Fixes: 70fadc41635b9b6 ("xen/cpupool: support moving domain between cpupools with different granularity")
Reported-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched/core.c