From: Wei Liu Date: Thu, 3 Mar 2016 16:01:58 +0000 (+0000) Subject: libxc: simplify error handling in meminit_hvm X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1560 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ae3c165b8189cb45b437fe6d92da338f2fd3a19f;p=xen.git libxc: simplify error handling in meminit_hvm The hunk that prints out error message can only be reached from the loop that allocates memory. Move that hunk into the loop to avoid confusing gcc. Reported-by: Doug Goldstein Signed-off-by: Wei Liu Reviewed-by: Doug Goldstein Acked-by: Roger Pau Monne --- diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index e13a4aa01f..bdec40ad1f 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -1550,13 +1550,10 @@ static int meminit_hvm(struct xc_dom_image *dom) } if ( rc != 0 ) - break; - } - - if ( rc != 0 ) - { - DOMPRINTF("Could not allocate memory for HVM guest."); - goto error_out; + { + DOMPRINTF("Could not allocate memory for HVM guest."); + goto error_out; + } } DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");