Upgrade to 4.4.50-rt62
[kvmfornfv.git] / kernel / drivers / scsi / lpfc / lpfc_scsi.c
index 4679ed4..bae36cc 100644 (file)
@@ -3859,7 +3859,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
        uint32_t tag;
        uint16_t hwq;
 
-       if (shost_use_blk_mq(cmnd->device->host)) {
+       if (cmnd && shost_use_blk_mq(cmnd->device->host)) {
                tag = blk_mq_unique_tag(cmnd->request);
                hwq = blk_mq_unique_tag_to_hwq(tag);
 
@@ -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);