]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/domain: fix error path in domain_create()
authorStewart Hildebrand <stewart.hildebrand@amd.com>
Tue, 5 Dec 2023 09:00:51 +0000 (10:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2023 09:00:51 +0000 (10:00 +0100)
If rangeset_new() fails, err would not be set to an appropriate error
code. Set it to -ENOMEM.

Fixes: 580c458699e3 ("xen/domain: Call arch_domain_create() as early as possible in domain_create()")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/domain.c

index cd2ca6d49a5ef21cec7f9ec0fd8f584a8d02b2b1..c5954cdb1ac2a954ae6aa26a88c468b038b2a906 100644 (file)
@@ -710,6 +710,7 @@ struct domain *domain_create(domid_t domid,
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
+        err = -ENOMEM;
         d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
         d->irq_caps   = rangeset_new(d, "Interrupts", 0);
         if ( !d->iomem_caps || !d->irq_caps )