Skip to content

Commit

Permalink
lpfc: Fix crash in device reset handler.
Browse files Browse the repository at this point in the history
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
  • Loading branch information
James Smart authored and James Bottomley committed Apr 10, 2015
1 parent 6c7cf48 commit ad490b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5118,9 +5118,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
int status;

rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
if (!rdata) {
if (!rdata || !rdata->pnode) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"0798 Device Reset rport failure: rdata x%p\n", rdata);
"0798 Device Reset rport failure: rdata x%p\n",
rdata);
return FAILED;
}
pnode = rdata->pnode;
Expand Down

0 comments on commit ad490b6

Please sign in to comment.