On Sun, Feb 26, 2017 at 03:49:31PM +0000, Wei Liu wrote:
> Switch to use goto style error handling to avoid leaking madt.

Thanks, I guess it's fine to don't leak memory here, but in any case this is
doomed to fail, no further progress is going to be made if Dom0 build fails,
hence that's why memory leaks here are not really meaningful.

> Coverity-ID: 1401534
> 
> Signed-off-by: Wei Liu <wei.l...@citrix.com>

Reviewed-by: Roger Pau Monné <roger....@citrix.com>

> ---
>  xen/arch/x86/domain_build.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index 0534838c8e..1f18f9283f 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -2290,7 +2290,8 @@ static int __init pvh_setup_acpi_madt(struct domain *d, 
> paddr_t *addr)
>      if ( !madt )
>      {
>          printk("Unable to allocate memory for MADT table\n");
> -        return -ENOMEM;
> +        rc = -ENOMEM;
> +        goto out;

This one doesn't need the goto, there's nothing leaked here (although there's
also no problem in doing in that way).

Roger.

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

Reply via email to