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

[xen master] tools/xl: Fix exit code for `xl vkbattach`



commit 8e5b2029feee1961d6753127bf249c7a8c8f89a5
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Feb 11 18:49:23 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Feb 17 12:37:08 2021 +0000

    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: a15166af7c3 ("xl: add vkb config parser and CLI")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
    Release-Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 tools/xl/xl_vkb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/xl/xl_vkb.c b/tools/xl/xl_vkb.c
index f6ed9e05ee..728ac9470b 100644
--- a/tools/xl/xl_vkb.c
+++ b/tools/xl/xl_vkb.c
@@ -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:
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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