Skip to content

Commit

Permalink
Cleanup: Delete dead code from send_merge_thread()
Browse files Browse the repository at this point in the history
range is always deferenced before it reaches this check, such that the
kmem_zalloc() call is never executed.

A previously version of this had erronously also pruned the
`range->eos_marker = B_TRUE` line, but it must be set whenever we
encounter an error or are cancelled early.

Coverity incorrectly complained about a potential NULL pointer
dereference because of this.

Reported-by: Coverity (CID 1524550)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14210
  • Loading branch information
ryao authored and behlendorf committed Nov 29, 2022
1 parent b5459dd commit 8532da5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,8 +1586,6 @@ send_merge_thread(void *arg)
}
range_free(front_ranges[i]);
}
if (range == NULL)
range = kmem_zalloc(sizeof (*range), KM_SLEEP);
range->eos_marker = B_TRUE;
bqueue_enqueue_flush(&smt_arg->q, range, 1);
spl_fstrans_unmark(cookie);
Expand Down

0 comments on commit 8532da5

Please sign in to comment.