Skip to content

Commit 8ac0eec

Browse files
committed
nvme/streams: avoid allocating too large a buffer
We only need to allocate as many data structures as there were stream IDs provided. Signed-off-by: Vincent Fu <[email protected]>
1 parent 40176e3 commit 8ac0eec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dataplacement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f)
5252
log_err("fio: stream IDs must be provided for dataplacement=streams\n");
5353
return -EINVAL;
5454
}
55-
ruhs = scalloc(1, sizeof(*ruhs) + FIO_MAX_DP_IDS * sizeof(*ruhs->plis));
55+
ruhs = scalloc(1, sizeof(*ruhs) + td->o.dp_nr_ids * sizeof(*ruhs->plis));
5656
if (!ruhs)
5757
return -ENOMEM;
5858

0 commit comments

Comments
 (0)