Skip to content

Commit

Permalink
nvme/streams: avoid allocating too large a buffer
Browse files Browse the repository at this point in the history
We only need to allocate as many data structures as there were stream
IDs provided.

Signed-off-by: Vincent Fu <[email protected]>
  • Loading branch information
vincentkfu committed Aug 5, 2024
1 parent 40176e3 commit 8ac0eec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dataplacement.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f)
log_err("fio: stream IDs must be provided for dataplacement=streams\n");
return -EINVAL;
}
ruhs = scalloc(1, sizeof(*ruhs) + FIO_MAX_DP_IDS * sizeof(*ruhs->plis));
ruhs = scalloc(1, sizeof(*ruhs) + td->o.dp_nr_ids * sizeof(*ruhs->plis));
if (!ruhs)
return -ENOMEM;

Expand Down

0 comments on commit 8ac0eec

Please sign in to comment.