summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2022-08-11 23:01:42 -0400
committerTheodore Ts'o <tytso@mit.edu>2022-08-11 23:01:42 -0400
commit45dc484a25f234722f6b0fe4f8fc12080429a1dd (patch)
treecf21eff82053e312982190337e633da0058866c0 /e2fsck
parent1bd16e790308f92e89a5dfbd40ab9e164fe88aa9 (diff)
downloade2fsprogs-45dc484a25f234722f6b0fe4f8fc12080429a1dd.tar.gz
e2fsck: streamline problem latch handling
No functional changes, but streamline the logic, and avoid a coverity warning. Addresses-Coverity-Bug: 1507763 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/problem.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 95f0ace8..e2572f59 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -2494,8 +2494,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
if ((ctx->options & E2F_OPT_PREEN) &&
(ptr->flags & PR_PREEN_OK))
suppress++;
- if ((ptr->flags & PR_LATCH_MASK) &&
- (ldesc->flags & (PRL_YES | PRL_NO)))
+ if (ldesc && (ldesc->flags & (PRL_YES | PRL_NO)))
suppress++;
if (ptr->count == ptr->max_count + 1) {
if (ctx->problem_logf)
@@ -2540,8 +2539,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
answer = def_yn;
if (!(ptr->flags & PR_PREEN_NOMSG))
print_answer = 1;
- } else if ((ptr->flags & PR_LATCH_MASK) &&
- (ldesc->flags & (PRL_YES | PRL_NO))) {
+ } else if (ldesc && (ldesc->flags & (PRL_YES | PRL_NO))) {
print_answer = 1;
if (ldesc->flags & PRL_YES)
answer = 1;