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:
Julien Grall authored and Ian Campbell committed 2013-12-09 09:58:55 +00:00
1 parent 2f718161bc
commit 2e213747ac
1 file changed
+1 -1
+1 -1
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.