From: Darrick J. Wong Date: Mon, 11 Nov 2019 15:06:46 +0000 (-0500) Subject: xfs_scrub: fix complaint about uninitialized ret X-Git-Tag: v5.3.0-rc2~2 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fxfsprogs-dev.git;a=commitdiff_plain;h=c3387fb8857bcb95ea92f3c94e682f0b483f621b xfs_scrub: fix complaint about uninitialized ret Coverity complained about the uninitialized ret in run_scrub_phases. It's not sophisticated enough to realize that phase 1 and 7 are both marked mustrun and are never the repair or datascan dummies and that therefore ret is always initialized by the end of the for loop, but OTOH there's no reason not to fix a trivial logic bomb if that ever changes. Coverity-id: 1455255 Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index a792768c5..014c54dd7 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -422,7 +422,7 @@ run_scrub_phases( unsigned int debug_phase = 0; unsigned int phase; int rshift; - int ret; + int ret = 0; if (debug_tweak_on("XFS_SCRUB_PHASE")) debug_phase = atoi(getenv("XFS_SCRUB_PHASE"));