Skip to content

Commit

Permalink
tcmur: error if both src/dst_dev are unset after CSCD parsing
Browse files Browse the repository at this point in the history
A null src_dev and dst_dev pointer appears to be quite possible after
CSCD list parsing, so this error condition should be handled.

Fixes: 9c86bd0 ("tcmur: Add emulate XCOPY command support")
Signed-off-by: David Disseldorp <ddiss@suse.de>
  • Loading branch information
ddiss committed Jan 13, 2021
1 parent 170bfa6 commit 01685b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tcmur_cmd_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ static int xcopy_parse_target_descs(struct tcmu_device *udev,
}
}

ret = TCMU_STS_CP_TGT_DEV_NOTCONN;
if (xcopy->src_dev)
ret = xcopy_locate_udev(udev->ctx, xcopy->dst_tid_wwn,
&xcopy->dst_dev);
Expand Down

0 comments on commit 01685b2

Please sign in to comment.