tools/tests: fix an xs-test.c issue

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 3a2b8525b8)
This commit is contained in:
Wei Liu authored and Ian Jackson committed 2018-10-08 15:31:28 +01:00
1 parent a2e35a7592
commit 33664f9a05
1 file changed
+1 -1
+1 -1
View 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;
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.