[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.17] xen/domain: fix error path in domain_create()



commit 6eb98dda5c91e68555684c57a2c9bd119ff082c1
Author:     Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
AuthorDate: Wed Dec 6 10:49:54 2023 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Dec 6 10:49:54 2023 +0100

    xen/domain: fix error path in domain_create()
    
    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@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: ff1178062094837d55ef342070e58316c43a54c9
    master date: 2023-12-05 10:00:51 +0100
---
 xen/common/domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 30c2279673..8f924d5cdd 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -674,6 +674,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 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.