lpfc: Fix null ndlp dereference in target_reset_handler
Subsystems (2)
PATCH 12/21 lpfc: Fix null ndlp dereference in target_reset_handler
Fix null ndlp dereference in target_reset_handler
Signed-off-by Dick Kennedy <[email protected]>
Signed-off-by James Smart <[email protected]>
--- drivers/scsi/lpfc/lpfc_scsi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +6 -4
@@ -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 ;
Signature · 1 line
1.7.11.7
Quoted 5 lines · James Smart
Fix null ndlp dereference in
target_reset_handlerSigned-off-by Dick Kennedy <[email protected]>Signed-off-by James Smart <[email protected]>---
Reviewed-by Hannes Reinecke <[email protected]>
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html