lpfc: Fix crash in fcp command completion path.
authorJames Smart <james.smart@avagotech.com>
Wed, 16 Dec 2015 23:11:57 +0000 (18:11 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 22 Dec 2015 02:54:30 +0000 (21:54 -0500)
Fix crash in fcp command completion path.

Missed null check.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 4679ed4444a737e906342473031397b2137443ff..ab446f83fba6fcd0a35a4e44429ff9758ed2bde3 100644 (file)
@@ -3908,9 +3908,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
        uint32_t logit = LOG_FCP;
 
        /* Sanity check on return of outstanding command */
-       if (!(lpfc_cmd->pCmd))
-               return;
        cmd = lpfc_cmd->pCmd;
+       if (!cmd)
+               return;
        shost = cmd->device->host;
 
        lpfc_cmd->result = (pIocbOut->iocb.un.ulpWord[4] & IOERR_PARAM_MASK);