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>
This commit is contained in:
Wei Liu committed 2018-08-20 11:50:17 +01:00
1 parent 48a70499e6
commit 3a2b8525b8
1 file changed
+1 -1
+1 -1
View File
@@ -66,7 +66,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.