Skip to content

Commit

Permalink
Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13885
  • Loading branch information
ryao authored and tonyhutter committed Sep 21, 2022
1 parent 035e52f commit 5096ed3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/dmu_redact.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 5096ed3

Please sign in to comment.