scst: fix possible error path crash in debug mode

It could happen, if a non-pass-through dev handler erroneously returned
SCST_EXEC_NOT_COMPLETED and TRAGE_DBG() statements enabled in debug mode.

Reported-by: Jeff Goldszer <jeff.goldszer@alebra.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6905 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2016-06-30 04:05:14 +00:00
parent 528f5e0004
commit 4092e26bba
+4 -4
View File
@@ -3464,10 +3464,6 @@ static int scst_do_real_exec(struct scst_cmd *cmd)
scsi_dev = dev->scsi_dev;
TRACE_DBG("Sending cmd %p to SCSI mid-level dev %d:%d:%d:%lld", cmd,
scsi_dev->host->host_no, scsi_dev->channel, scsi_dev->id,
(u64)scsi_dev->lun);
if (unlikely(scsi_dev == NULL)) {
PRINT_ERROR("Command for virtual device must be "
"processed by device handler (LUN %lld)!",
@@ -3475,6 +3471,10 @@ static int scst_do_real_exec(struct scst_cmd *cmd)
goto out_error;
}
TRACE_DBG("Sending cmd %p to SCSI mid-level dev %d:%d:%d:%lld", cmd,
scsi_dev->host->host_no, scsi_dev->channel, scsi_dev->id,
(u64)scsi_dev->lun);
scst_set_exec_start(cmd);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)