x86/hvm: add check when register io handler
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 8 Jun 2016 12:13:59 +0000 (14:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jun 2016 12:13:59 +0000 (14:13 +0200)
At the time of registering HVM I/O handler, the HVM domain might
not have been initialized, which means the hvm_domain.io_handler
would be NULL. In the hvm_next_io_handler(), this should be asserted.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
xen/arch/x86/hvm/intercept.c

index fc757d0af7698fe4619c7358a5fd1850fa4eff2f..bf141c990575772f528e006d4dc608c24d7567e0 100644 (file)
@@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d)
 {
     unsigned int i = d->arch.hvm_domain.io_handler_count++;
 
+    ASSERT(d->arch.hvm_domain.io_handler);
+
     if ( i == NR_IO_HANDLERS )
     {
         domain_crash(d);