Fixes possible oopses on scst_cmd dereference.
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 20 Mar 2009 18:40:55 +0000 (18:40 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 20 Mar 2009 18:40:55 +0000 (18:40 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@708 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/kernel/iscsi.c
iscsi-scst/kernel/nthread.c

index dc74c17..eeafbe5 100644 (file)
@@ -297,7 +297,6 @@ void cmnd_done(struct iscsi_cmnd *cmnd)
                        }
                }
        } else {
-               EXTRACHECKS_BUG_ON(cmnd->scst_cmd != NULL);
                TRACE_DBG("Deleting rsp %p from parent %p", cmnd,
                        cmnd->parent_req);
 
index 9432add..8b8a4f4 100644 (file)
@@ -273,7 +273,8 @@ static void trace_conn_close(struct iscsi_conn *conn)
                        "data_waiting %d, ref_cnt %d, sn %u, "
                        "parent_req %p, pending %d",
                        cmnd, cmnd->scst_state,
-                       cmnd->scst_cmd ? cmnd->scst_cmd->state : -1,
+                       (cmnd->parent_req && cmnd->scst_cmd) ?
+                               cmnd->scst_cmd->state : -1,
                        cmnd->data_waiting, atomic_read(&cmnd->ref_cnt),
                        cmnd->pdu.bhs.sn, cmnd->parent_req, cmnd->pending);
 #if defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION)