tools/libxl: Fix uninitialised variable in libxl__write_stub_dmargs()

Various version of gcc, when compiling with -Og, complain:

  libxl_dm.c: In function ‘libxl__write_stub_dmargs’:
  libxl_dm.c:2166:16: error: ‘dmargs’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
               rc = libxl__xs_write_checked(gc, t, path, dmargs);
               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It isn't actually used while uninitialised, but only because of how the
is_linux_stubdom checks line up.

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:
Andrew Cooper committed 2021-02-17 12:37:08 +00:00
1 parent 928bffb6dd
commit b4159d2de0
1 file changed
+1 -1
+1 -1
View File
@@ -2101,7 +2101,7 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
{
struct xs_permissions roperm[2];
xs_transaction_t t = XBT_NULL;
char *dmargs;
char *dmargs = NULL;
int rc;
roperm[0].id = 0;
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.