From: Eric Sandeen <sandeen@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH 2/3] xfs_scrub: initialize movon in
Date: Tue, 27 Mar 2018 17:11:49 -0500 [thread overview]
Message-ID: <6fe699ea-cb0d-f7c6-4736-54138db30cef@redhat.com> (raw)
In-Reply-To: <f7ab3da2-618c-dc1c-6d95-3890cdac2b43@redhat.com>
Given the logic in xfs_scrub_connections, it's possible to
fail all 3 tests and wind up checking an uninitialized moveon
variable at the end. Start out with "true" to avoid this and
move on even if all the conditions in the function are false.
Fixes-coverity-id: 1433617
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/scrub/phase5.c b/scrub/phase5.c
index 8e0a1be..5f2a1a7 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -244,7 +244,7 @@ xfs_scrub_connections(
{
bool *pmoveon = arg;
char descr[DESCR_BUFSZ];
- bool moveon;
+ bool moveon = true;
xfs_agnumber_t agno;
xfs_agino_t agino;
int fd = -1;
next prev parent reply other threads:[~2018-03-27 22:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 22:04 [PATCH 0/3] xfsprogs: misc coverity fixes Eric Sandeen
2018-03-27 22:08 ` [PATCH 1/3] xfs_scrub: synchronize error levels & logging Eric Sandeen
2018-03-27 22:14 ` Darrick J. Wong
2018-03-27 22:20 ` Eric Sandeen
2018-03-27 22:22 ` Darrick J. Wong
2018-03-27 22:27 ` [PATCH 1/3 V2] " Eric Sandeen
2018-03-27 22:31 ` Darrick J. Wong
2018-03-27 22:11 ` Eric Sandeen [this message]
2018-03-27 22:14 ` [PATCH 2/3] xfs_scrub: initialize movon in Darrick J. Wong
2018-03-27 22:14 ` [PATCH 3/3] libfrog: enforce dir XOR blkdev in __fs_table_lookup_mount Eric Sandeen
2018-03-27 22:19 ` Darrick J. Wong
2018-03-27 22:33 ` [PATCH 3/3 V2] libfrog: handle NULL dir && " Eric Sandeen
2018-03-27 22:37 ` Darrick J. Wong
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=6fe699ea-cb0d-f7c6-4736-54138db30cef@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-xfs@vger.kernel.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).