mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/arm: arch_domain_create: don't return 0 when alloc_xenheap_pages has failed
The previous call before alloc_xenheap_pages reset rc to 0 if it success. If the latter fails, arch_domain_create will return 0 and Xen will consider the domain as valid. Move rc initialization later. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
2f718161bc
commit
2e213747ac
1 file changed
+1
-1
@@ -501,10 +501,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
|
||||
if ( is_idle_domain(d) )
|
||||
return 0;
|
||||
|
||||
rc = -ENOMEM;
|
||||
if ( (rc = p2m_init(d)) != 0 )
|
||||
goto fail;
|
||||
|
||||
rc = -ENOMEM;
|
||||
if ( (d->shared_info = alloc_xenheap_pages(0, 0)) == NULL )
|
||||
goto fail;
|
||||
|
||||
|
||||