Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b32bd0a8 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Nicholas Bellinger
Browse files

target/transport: Always initialize bidi fields in se_cmd



Fields t_bidi_data_sg and t_bidi_data_nents are set only in the presence
of BIDI commands. This means that the underlying code (for example TCMU)
cannot inspect them when the SCSI command is not a BIDI one.

Ensure the code always initializes these fields with the given values,
even when the SCSI command is not a BIDI one. Set t_bidi_data_sg to
sgl_bidi (which should be NULL for non-BIDI commands) and
t_bidi_data_nents to sgl_bidi_count (which should be 0 for non-BIDI
commands). This allows the underlying code to use these fields
unconditionally.

Signed-off-by: default avatarIlias Tsitsimpis <iliastsi@arrikto.com>
Signed-off-by: default avatarVangelis Koukis <vkoukis@arrikto.com>
Reviewed-by: default avatarAndy Grover <agrover@redhat.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 9736f4ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment