From: Eric Sandeen Date: Tue, 27 Mar 2018 22:43:37 +0000 (-0500) Subject: xfs_scrub: initialize movon in xfs_scrub_connections X-Git-Tag: v4.16.0-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d135e8444aa33de7818c730d5a71d4517dcbd4f;p=thirdparty%2Fxfsprogs-dev.git xfs_scrub: initialize movon in xfs_scrub_connections 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/scrub/phase5.c b/scrub/phase5.c index 8e0a1be97..5f2a1a7cd 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;