diff options
author | James Smart <james.smart@emulex.com> | 2015-04-07 21:07:20 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-10 16:49:10 +0200 |
commit | 63e480fd2f598e9ad37f89e79c36834e7dd60ba0 (patch) | |
tree | 71d75fa200030fd26b1b6fb3c065e96c0c88d57f /drivers/scsi | |
parent | lpfc: Fix FDMI Fabric support in driver for Brocade (diff) | |
download | linux-63e480fd2f598e9ad37f89e79c36834e7dd60ba0.tar.xz linux-63e480fd2f598e9ad37f89e79c36834e7dd60ba0.zip |
lpfc: Fix null ndlp dereference in target_reset_handler
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index f6232991fb37..5612ba6bf213 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -5202,10 +5202,12 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) if (status == FAILED) { lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, "0722 Target Reset rport failure: rdata x%p\n", rdata); - spin_lock_irq(shost->host_lock); - pnode->nlp_flag &= ~NLP_NPR_ADISC; - pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; - spin_unlock_irq(shost->host_lock); + if (pnode) { + spin_lock_irq(shost->host_lock); + pnode->nlp_flag &= ~NLP_NPR_ADISC; + pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; + spin_unlock_irq(shost->host_lock); + } lpfc_reset_flush_io_context(vport, tgt_id, lun_id, LPFC_CTX_TGT); return FAST_IO_FAIL; |