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 <cardoe@cardoe.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Roger Pau Monne <roger.pau@citrix.com>
This commit is contained in:
Wei Liu committed 2016-03-10 18:40:17 +00:00
1 parent f233dd6bcd
commit ae3c165b81
1 file changed
+4 -7
+4 -7
View File
@@ -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");
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.