xen/domain: fix error path in domain_create()
PATCH 1/1 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 <[email protected]>
--- xen/common/domain.c | 1 + 1 file changed, 1 insertion(+)
xen/common/domain.c +1 -0
@@ -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 )
Signature · 1 line
2.43.0
Quoted 5 lines · Stewart Hildebrand
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 <[email protected]>
Reviewed-by Jan Beulich <[email protected]>