Merge of r1201:

Don't call target drivers' on_free_cmd() for internal commands



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.1.x@1202 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-10-12 11:50:49 +00:00
parent fae27e736b
commit 4b85d299eb

View File

@@ -2055,7 +2055,7 @@ void scst_free_cmd(struct scst_cmd *cmd)
if (!cmd->tgt_data_buf_alloced)
scst_check_restore_sg_buff(cmd);
if (cmd->tgtt->on_free_cmd != NULL) {
if ((cmd->tgtt->on_free_cmd != NULL) && likely(!cmd->internal)) {
TRACE_DBG("Calling target's on_free_cmd(%p)", cmd);
cmd->tgtt->on_free_cmd(cmd);
TRACE_DBG("%s", "Target's on_free_cmd() returned");