[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] tools/libxl: Fix uninitialised variable in libxl__write_stub_dmargs()



commit b4159d2de0153eb8ce6aced1978e1917c07cf39d
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Feb 11 17:44:36 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Feb 17 12:37:08 2021 +0000

    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@xxxxxxxxxx>
    Reviewed-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
    Release-Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 291dee9b3f..db4cec6a76 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -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;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.