scst_event: Fix the code that copies the CDB of the command to be aborted

I came across this accidentally while looking up the users of the
cmd_to_abort pointer.

Fixes: 297d268a7a ("SCST events infrastructure"; r6574)



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9230 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-12-21 23:58:29 +00:00
parent 5826f2c8de
commit e3c8aedb2c

View File

@@ -472,8 +472,9 @@ int scst_event_queue_tm_fn_received(struct scst_mgmt_cmd *mcmd)
sizeof(payload->session_sysfs_name));
if (mcmd->cmd_to_abort != NULL) {
payload->cmd_to_abort_tag = mcmd->cmd_to_abort->tag;
strlcpy(payload->cdb, mcmd->cmd_to_abort->cdb,
sizeof(payload->cdb));
memcpy(payload->cdb, mcmd->cmd_to_abort->cdb,
min_t(u32, mcmd->cmd_to_abort->cdb_len,
sizeof(payload->cdb)));
}
scst_event_queue(SCST_EVENT_TM_FN_RECEIVED,