dmu_recv: Avoid potential null deref

Compilers are smart enough to deref only if the first && operand is
true, so this is mostly to avoid false positives from sanitizers.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Igor Ostapenko <[email protected]>
Closes #18848
This commit is contained in:
Igor Ostapenko authored and GitHub committed 2026-07-24 13:01:58 -07:00
1 parent a04c401389
commit 3020c18ca8
1 file changed
+3 -1
+3 -1
View File
@@ -3402,7 +3402,9 @@ receive_process_write_record(struct receive_writer_arg *rwa,
}
struct receive_record_arg *first_rrd = list_head(&rwa->write_batch);
struct drr_write *first_drrw = &first_rrd->header.drr_u.drr_write;
struct drr_write *first_drrw = NULL;
if (first_rrd != NULL)
first_drrw = &first_rrd->header.drr_u.drr_write;
uint64_t batch_size =
MIN(zfs_recv_write_batch_size, DMU_MAX_ACCESS / 2);
if (first_rrd != NULL &&