[SCSI] lpfc 8.1.2: Fix panic caused by HBA resets and target side cable pulls
authorJamie Wellnitz <Jamie.Wellnitz@emulex.com>
Wed, 1 Mar 2006 00:25:36 +0000 (19:25 -0500)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Wed, 1 Mar 2006 01:05:14 +0000 (19:05 -0600)
Fix panic caused by HBA resets and target side cable pulls

Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/lpfc/lpfc_scsi.c

index fd7540ea4e19f789f1067aaa9c4c72ec2fc0e972..094f18f1fa05c0ba6ba3aa580a151497d2804c08 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2004-2005 Emulex.  All rights reserved.           *
+ * Copyright (C) 2004-2006 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
  * www.emulex.com                                                  *
  * Portions Copyright (C) 2004-2005 Christoph Hellwig              *
@@ -467,7 +467,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
        sdev = cmd->device;
        cmd->scsi_done(cmd);
 
-       if (!result &&
+       if (!result && pnode != NULL &&
           ((jiffies - pnode->last_ramp_up_time) >
                LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
           ((jiffies - pnode->last_q_full_time) >
@@ -495,7 +495,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
         * Check for queue full.  If the lun is reporting queue full, then
         * back off the lun queue depth to prevent target overloads.
         */
-       if (result == SAM_STAT_TASK_SET_FULL) {
+       if (result == SAM_STAT_TASK_SET_FULL && pnode != NULL) {
                pnode->last_q_full_time = jiffies;
 
                shost_for_each_device(tmp_sdev, sdev->host) {