diff options
author | Richard Yao <[email protected]> | 2022-11-16 16:38:19 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-11-29 09:59:53 -0800 |
commit | 8532da5e20b90bed8decd22726a70c7c81ef6951 (patch) | |
tree | 20e74ba0b09cfa9bac3e46509552cefd61b084e3 /module | |
parent | b5459dd3541e76a46d3c49b480742ded05c429fd (diff) |
Cleanup: Delete dead code from send_merge_thread()
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 <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14210
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/dmu_send.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index ccb7eb207..fbf19d5c3 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -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); |