All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Albershteyn <aalbersh@redhat.com>
To: cem@kernel.org, linux-xfs@vger.kernel.org
Cc: djwong@kernel.org, Andrey Albershteyn <aalbersh@redhat.com>,
	Bill O'Donnell <bodonnel@redhat.com>
Subject: [PATCH v3 3/4] xfs_scrub: don't call phase_end if phase_rusage was not initialized
Date: Wed, 17 Apr 2024 14:52:27 +0200	[thread overview]
Message-ID: <20240417125227.916015-5-aalbersh@redhat.com> (raw)
In-Reply-To: <20240417125227.916015-2-aalbersh@redhat.com>

If unicrash_load() fails, all_pi can be used uninitialized in
phase_end(). Fix it by going to the unload: section if unicrash_load
fails and just go with unicrash_unload() (the is_service won't be
initialized here).

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
---
 scrub/xfs_scrub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index 752180d646ba..50565857ddd8 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -631,7 +631,7 @@ main(
 		fprintf(stderr,
 	_("%s: couldn't initialize Unicode library.\n"),
 				progname);
-		goto out;
+		goto out_unicrash;
 	}
 
 	pthread_mutex_init(&ctx.lock, NULL);
@@ -828,6 +828,7 @@ out:
 	phase_end(&all_pi, 0);
 	if (progress_fp)
 		fclose(progress_fp);
+out_unicrash:
 	unicrash_unload();
 
 	/*
-- 
2.42.0


  parent reply	other threads:[~2024-04-17 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 12:52 [PATCH v3 0/4] xfsprogs random fixes found by Coverity scan Andrey Albershteyn
2024-04-17 12:52 ` [PATCH v3 1/4] xfs_db: fix leak in flist_find_ftyp() Andrey Albershteyn
2024-04-17 15:20   ` Christoph Hellwig
2024-04-17 12:52 ` [PATCH v3 2/4] xfs_repair: make duration take time_t Andrey Albershteyn
2024-04-17 15:21   ` Christoph Hellwig
2024-04-17 12:52 ` Andrey Albershteyn [this message]
2024-04-17 12:52 ` [PATCH v3 4/4] xfs_fsr: convert fsrallfs to use time_t instead of int Andrey Albershteyn
2024-04-17 15:19   ` 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=20240417125227.916015-5-aalbersh@redhat.com \
    --to=aalbersh@redhat.com \
    --cc=bodonnel@redhat.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.