Skip to content

Commit

Permalink
Merge branch 'coverity-fix' of https://github.com/ankit-sam/fio
Browse files Browse the repository at this point in the history
* 'coverity-fix' of https://github.com/ankit-sam/fio:
  iolog: fix reported defect from coverity scan
  • Loading branch information
axboe committed Jan 25, 2024
2 parents 4502ad2 + acc481b commit 90a0fbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion iolog.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,12 @@ 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)
/*
* The bandwidth-log option generates agg-read_bw.log,
* agg-write_bw.log and agg-trim_bw.log for which l->td is NULL.
* Check if l->td is valid before dereferencing it.
*/
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 90a0fbc

Please sign in to comment.