]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: fix uninitialized variable
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Jun 2026 06:05:38 +0000 (23:05 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 11 Jun 2026 10:26:04 +0000 (12:26 +0200)
If the action list is empty, we'll return random stack garbage because
we never set ret.  Found by Codex.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: a18f915ce76bc8 ("xfs_scrub: use repair_item to direct repair activities")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
scrub/repair.c

index b2c4232fe8cea1e733af9a1a247effa5b43f1f54..c3a8b3179600a68b6b4380f66e915abde5900a09 100644 (file)
@@ -719,7 +719,7 @@ action_list_process(
 {
        struct action_item              *aitem;
        struct action_item              *n;
-       int                             ret;
+       int                             ret = 0;
 
        list_for_each_entry_safe(aitem, n, &alist->list, list) {
                if (scrub_excessive_errors(ctx))