xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH] tools/tests: fix an xs-test.c issue
Date: Mon, 20 Aug 2018 09:38:18 +0100	[thread overview]
Message-ID: <20180820083818.8464-1-wei.liu2@citrix.com> (raw)

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

             reply	other threads:[~2018-08-20  8:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20  8:38 Wei Liu [this message]
2018-08-20 10:39 ` [PATCH] tools/tests: fix an xs-test.c issue Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180820083818.8464-1-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).