xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxc: simplify error handling in meminit_hvm
@ 2016-03-03 16:09 Wei Liu
  2016-03-07 16:02 ` Doug Goldstein
  2016-03-07 16:12 ` Roger Pau Monné
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Liu @ 2016-03-03 16:09 UTC (permalink / raw)
  To: Xen-devel; +Cc: Ian Jackson, Roger Pau Monne, Wei Liu, Stefano Stabellini

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 <cardoe@cardoe.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxc/xc_dom_x86.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e13a4aa..bdec40a 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");
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-07 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 16:09 [PATCH] libxc: simplify error handling in meminit_hvm Wei Liu
2016-03-07 16:02 ` Doug Goldstein
2016-03-07 16:12 ` Roger Pau Monné

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).