From 5096ed31c8c3d5fb673b34a2e555da6f9e0dc62b Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Thu, 15 Sep 2022 19:21:21 -0400 Subject: [PATCH] Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c We pass sizeof (struct redact_record *) rather than sizeof (struct redact_record). Passing the pointer size is wrong. Coverity caught this in two places. Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #13885 --- module/zfs/dmu_redact.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zfs/dmu_redact.c b/module/zfs/dmu_redact.c index 7efe423d35..5184ef6888 100644 --- a/module/zfs/dmu_redact.c +++ b/module/zfs/dmu_redact.c @@ -141,7 +141,7 @@ record_merge_enqueue(bqueue_t *q, struct redact_record **build, { if (new->eos_marker) { if (*build != NULL) - bqueue_enqueue(q, *build, sizeof (*build)); + bqueue_enqueue(q, *build, sizeof (**build)); bqueue_enqueue_flush(q, new, sizeof (*new)); return; } @@ -823,7 +823,7 @@ perform_thread_merge(bqueue_t *q, uint32_t num_threads, avl_destroy(&end_tree); kmem_free(redact_nodes, num_threads * sizeof (*redact_nodes)); if (current_record != NULL) - bqueue_enqueue(q, current_record, sizeof (current_record)); + bqueue_enqueue(q, current_record, sizeof (*current_record)); return (err); }