mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xl: Fix exit code for xl vkbattach
Various version of gcc, when compiling with -Og, complain:
xl_vkb.c: In function 'main_vkbattach':
xl_vkb.c:79:12: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
79 | return rc;
| ^~
The dryrun_only path really does leave rc uninitalised. Introduce a done
label for success paths to use.
Fixes: a15166af7c ("xl: add vkb config parser and CLI")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
This commit is contained in:
1 parent
d670ef3401
commit
8e5b2029fe
1 file changed
+2
-1
+2
-1
@@ -64,7 +64,7 @@ int main_vkbattach(int argc, char **argv)
|
||||
char *json = libxl_device_vkb_to_json(ctx, &vkb);
|
||||
printf("vkb: %s\n", json);
|
||||
free(json);
|
||||
goto out;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (libxl_device_vkb_add(ctx, domid, &vkb, 0)) {
|
||||
@@ -72,6 +72,7 @@ int main_vkbattach(int argc, char **argv)
|
||||
rc = ERROR_FAIL; goto out;
|
||||
}
|
||||
|
||||
done:
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||