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.

There is also no need to set `range->eos_marker = B_TRUE` because it is
already set.

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

Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
  • Loading branch information
ryao committed Oct 17, 2022
1 parent dba4be4 commit cf0edf3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,9 +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);
thread_exit();
Expand Down

0 comments on commit cf0edf3

Please sign in to comment.