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

[Xen-changelog] [xen master] xen/arm: arch_domain_create: don't return 0 when alloc_xenheap_pages has failed



commit 2e213747ac49a382eeed2d493e767496482da2c8
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Sun Dec 8 02:32:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Dec 9 09:58:55 2013 +0000

    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@xxxxxxxxxx>
    Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/arch/arm/domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 52d2403..67c65c3 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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