Commit 22466da5 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen

lpfc: Fix possible NULL pointer dereference

Check for the existence of piocb->vport before accessing it.
Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Acked-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d242e668
...@@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
{ {
lockdep_assert_held(&phba->hbalock); lockdep_assert_held(&phba->hbalock);
BUG_ON(!piocb || !piocb->vport);
list_add_tail(&piocb->list, &pring->txcmplq); list_add_tail(&piocb->list, &pring->txcmplq);
piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ; piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ;
if ((unlikely(pring->ringno == LPFC_ELS_RING)) && if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
(piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) && (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
(!(piocb->vport->load_flag & FC_UNLOADING))) { (!(piocb->vport->load_flag & FC_UNLOADING)))
if (!piocb->vport)
BUG();
else
mod_timer(&piocb->vport->els_tmofunc, mod_timer(&piocb->vport->els_tmofunc,
jiffies + jiffies +
msecs_to_jiffies(1000 * (phba->fc_ratov << 1))); msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment