]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/domain: fix error path in domain_create()
authorStewart Hildebrand <stewart.hildebrand@amd.com>
Wed, 6 Dec 2023 09:41:19 +0000 (10:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 6 Dec 2023 09:41:19 +0000 (10:41 +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>
master commit: ff1178062094837d55ef342070e58316c43a54c9
master date: 2023-12-05 10:00:51 +0100

xen/common/domain.c

index 8f9ab01c0cb79059efaf65e83eb7ca2338208c4b..003f4ab125252b74a56b43fb6c117f9b745f5748 100644 (file)
@@ -703,6 +703,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 )