]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Thu, 15 Sep 2022 23:21:21 +0000 (19:21 -0400)
committerGitHub <noreply@github.com>
Thu, 15 Sep 2022 23:21:21 +0000 (16:21 -0700)
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 #13885

module/zfs/dmu_redact.c

index 09ca7d509ce783364d3dd96e0eb07acfc2c2b20a..7afcc12313488fec29e2ecb9fef2c8874472abc0 100644 (file)
@@ -142,7 +142,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;
        }
@@ -824,7 +824,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);
 }