Skip to content

Commit

Permalink
iolog: fix reported defect from coverity scan
Browse files Browse the repository at this point in the history
Fix the two Null pointer dereferences issue reported by Coverity scan

Null pointer dereferences  (FORWARD_NULL)
Dereferencing null pointer "l->td"

Null pointer dereferences  (REVERSE_INULL)
Null-checking "p->td" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.

Signed-off-by: Ankit Kumar <[email protected]>
  • Loading branch information
ankit-sam committed Jan 25, 2024
1 parent 4502ad2 commit 3fba955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iolog.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ void setup_log(struct io_log **log, struct log_params *p,
l->log_ddir_mask = LOG_OFFSET_SAMPLE_BIT;
if (l->log_prio)
l->log_ddir_mask |= LOG_PRIO_SAMPLE_BIT;
if (l->td->o.log_max == IO_LOG_SAMPLE_BOTH)
if (l->td && l->td->o.log_max == IO_LOG_SAMPLE_BOTH)
l->log_ddir_mask |= LOG_AVG_MAX_SAMPLE_BIT;

INIT_FLIST_HEAD(&l->chunk_list);
Expand Down

0 comments on commit 3fba955

Please sign in to comment.