]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
tools/tests: fix an xs-test.c issue
authorWei Liu <wei.liu2@citrix.com>
Mon, 20 Aug 2018 08:38:18 +0000 (09:38 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 8 Oct 2018 14:31:28 +0000 (15:31 +0100)
The ret variable can be used uninitialised when iters is 0. Initialise
ret at the beginning to fix this issue.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit 3a2b8525b883baa87fe89b3da58f5c09fa599b99)

tools/tests/xenstore/xs-test.c

index eb5fe5572287439f40d4ff869c5979d3ee826b22..6f902dd6018dc410c5c21288ab32c70228627ead 100644 (file)
@@ -65,7 +65,7 @@ static int call_test(struct test *tst, int iters, bool no_clock)
     char *stage = "?";
     struct timespec tp1, tp2;
     uint64_t nsec, nsec_min, nsec_max, nsec_sum;
-    int i, ret;
+    int i, ret = 0;
 
     nsec_min = -1;
     nsec_max = 0;