* [PATCH] tools/tests: fix an xs-test.c issue
@ 2018-08-20 8:38 Wei Liu
2018-08-20 10:39 ` Ian Jackson
0 siblings, 1 reply; 2+ messages in thread
From: Wei Liu @ 2018-08-20 8:38 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Wei Liu
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>
---
tools/tests/xenstore/xs-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/tests/xenstore/xs-test.c b/tools/tests/xenstore/xs-test.c
index 17d4a66b85..c4c99c0661 100644
--- a/tools/tests/xenstore/xs-test.c
+++ b/tools/tests/xenstore/xs-test.c
@@ -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;
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools/tests: fix an xs-test.c issue
2018-08-20 8:38 [PATCH] tools/tests: fix an xs-test.c issue Wei Liu
@ 2018-08-20 10:39 ` Ian Jackson
0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2018-08-20 10:39 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel
Wei Liu writes ("[PATCH] 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.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-20 10:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-20 8:38 [PATCH] tools/tests: fix an xs-test.c issue Wei Liu
2018-08-20 10:39 ` Ian Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).