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

Re: [Xen-devel] [PATCH] xen/arm: arch_domain_create: don't return 0 when alloc_xenheap_pages has failed



On Sun, 8 Dec 2013, Julien Grall wrote:
> 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>


>  xen/arch/arm/domain.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
>  
> -- 
> 1.7.10.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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