ia64/xen-unstable

changeset 11513:2e6c10dc7c0b

[POWERPC][XEN] make sure put_domain() is called in case of allocate_rma() failuer

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Tue Sep 12 10:53:46 2006 -0400 (2006-09-12)
parents 13e406c85c8b
children 2ba5452795d2
files xen/arch/powerpc/dom0_ops.c
line diff
     1.1 --- a/xen/arch/powerpc/dom0_ops.c	Tue Sep 12 06:48:32 2006 -0400
     1.2 +++ b/xen/arch/powerpc/dom0_ops.c	Tue Sep 12 10:53:46 2006 -0400
     1.3 @@ -98,15 +98,14 @@ long arch_do_domctl(struct xen_domctl *d
     1.4          struct domain *d;
     1.5          unsigned int log = domctl->u.real_mode_area.log;
     1.6  
     1.7 +        ret = -ESRCH;
     1.8          d = find_domain_by_id(domctl->domain);
     1.9 -        if (d == NULL)
    1.10 -            return -ESRCH;
    1.11 -
    1.12 -        if (!cpu_rma_valid(log))
    1.13 -            return -EINVAL;
    1.14 -
    1.15 -        ret = allocate_rma(d, log - PAGE_SHIFT);
    1.16 -        put_domain(d);
    1.17 +        if (d != NULL) {
    1.18 +            ret = -EINVAL;
    1.19 +            if (cpu_rma_valid(log))
    1.20 +                ret = allocate_rma(d, log - PAGE_SHIFT);
    1.21 +            put_domain(d);
    1.22 +        }
    1.23      }
    1.24      break;
    1.25