Skip to content

Commit

Permalink
scsi: lpfc: Null pointer dereference when log_verbose is set to 0xfff…
Browse files Browse the repository at this point in the history
…fffff

Kernel panic when log_verbose is set to 0xffffffff

phba->pport is dereferenced before it is initialized

Fix: Do not dereference phba->pport if it is NULL

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
James Smart authored and Martin K. Petersen committed Jun 13, 2017
1 parent b83d005 commit e92974f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -7513,7 +7513,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
"(%d):0308 Mbox cmd issue - BUSY Data: "
"x%x x%x x%x x%x\n",
pmbox->vport ? pmbox->vport->vpi : 0xffffff,
mbx->mbxCommand, phba->pport->port_state,
mbx->mbxCommand,
phba->pport ? phba->pport->port_state : 0xff,
psli->sli_flag, flag);

psli->slistat.mbox_busy++;
Expand Down Expand Up @@ -7565,7 +7566,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
"(%d):0309 Mailbox cmd x%x issue Data: x%x x%x "
"x%x\n",
pmbox->vport ? pmbox->vport->vpi : 0,
mbx->mbxCommand, phba->pport->port_state,
mbx->mbxCommand,
phba->pport ? phba->pport->port_state : 0xff,
psli->sli_flag, flag);

if (mbx->mbxCommand != MBX_HEARTBEAT) {
Expand Down

0 comments on commit e92974f

Please sign in to comment.