Skip to content

Commit b4aafe7

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fix from James Bottomley: "One small fix for a regression in a prior fix (again). This time the condition in the prior fix BUG_ON proved to be wrong under certain circumstances causing a BUG to trigger where it shouldn't in the lpfc driver" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: lpfc: fix oops/BUG in lpfc_sli_ringtxcmpl_put()
2 parents 318c893 + ff682a3 commit b4aafe7

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,18 +1323,20 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
13231323
{
13241324
lockdep_assert_held(&phba->hbalock);
13251325

1326-
BUG_ON(!piocb || !piocb->vport);
1326+
BUG_ON(!piocb);
13271327

13281328
list_add_tail(&piocb->list, &pring->txcmplq);
13291329
piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ;
13301330

13311331
if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
13321332
(piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
1333-
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
1334-
(!(piocb->vport->load_flag & FC_UNLOADING)))
1335-
mod_timer(&piocb->vport->els_tmofunc,
1336-
jiffies +
1337-
msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
1333+
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) {
1334+
BUG_ON(!piocb->vport);
1335+
if (!(piocb->vport->load_flag & FC_UNLOADING))
1336+
mod_timer(&piocb->vport->els_tmofunc,
1337+
jiffies +
1338+
msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
1339+
}
13381340

13391341
return 0;
13401342
}

0 commit comments

Comments
 (0)