From 4092e26bba445542faaea3e1c6aebe8c7c946fb3 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 30 Jun 2016 04:05:14 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6905 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index e7d3cba55..214d221e6 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -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)