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.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes openzfs#14042
  • Loading branch information
ryao authored and andrewc12 committed Nov 9, 2022
1 parent 5ba1c23 commit 44eae4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,9 +1586,8 @@ 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;
ASSERT3P(range, !=, NULL);
ASSERT3S(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 44eae4c

Please sign in to comment.