x86/HVM: re-order error path of hvm_domain_initialise()
authorJan Beulich <jbeulich@suse.com>
Fri, 29 Jan 2021 10:36:54 +0000 (11:36 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 29 Jan 2021 10:36:54 +0000 (11:36 +0100)
commitfbb3bf002b42803ef289ea2a649ebd5f25d22236
treeee7ad5b32ca0c0b44d50c79c141eac15025edae8
parent3c9fd69416f8ffc611705fb24dfb383203ddc84f
x86/HVM: re-order error path of hvm_domain_initialise()

hvm_destroy_all_ioreq_servers(), called from
hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
which uses d->arch.hvm.io_handler. Defer freeing of this array
accordingly on the error path of hvm_domain_initialise().

Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
or else an armed timer structure would get freed, and that timer never
get killed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/hvm.c