linux/drivers/scsi/lpfc
James Smart 93a3922da4 scsi: lpfc: Fix driver crash when re-registering NVME rports.
During remote port loss fault testing, the driver crashed with the
following trace:

general protection fault: 0000 [#1] SMP
RIP: ... lpfc_nvme_register_port+0x250/0x480 [lpfc]
Call Trace:
 lpfc_nlp_state_cleanup+0x1b3/0x7a0 [lpfc]
 lpfc_nlp_set_state+0xa6/0x1d0 [lpfc]
 lpfc_cmpl_prli_prli_issue+0x213/0x440
 lpfc_disc_state_machine+0x7e/0x1e0 [lpfc]
 lpfc_cmpl_els_prli+0x18a/0x200 [lpfc]
 lpfc_sli_sp_handle_rspiocb+0x3b5/0x6f0 [lpfc]
 lpfc_sli_handle_slow_ring_event_s4+0x161/0x240 [lpfc]
 lpfc_work_done+0x948/0x14c0 [lpfc]
 lpfc_do_work+0x16f/0x180 [lpfc]
 kthread+0xc9/0xe0
 ret_from_fork+0x55/0x80

After registering a new remoteport, the driver is pulling an ndlp pointer
from the lpfc rport associated with the private area of a newly registered
remoteport. The private area is uninitialized, so it's garbage.

Correct by pulling the the lpfc rport pointer from the entering ndlp point,
then ndlp value from at rport. Note the entering ndlp may be replacing by
the rport->ndlp due to an address change swap.

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>
2018-08-02 15:45:19 -04:00
..
lpfc_attr.c scsi: lpfc: Fix sysfs Speed value on CNA ports 2018-08-02 15:45:18 -04:00
lpfc_attr.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_compat.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_crtn.h scsi: lpfc: remove ScsiResult macro 2018-07-10 22:42:47 -04:00
lpfc_ct.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_debugfs.c scsi: lpfc: Comment cleanup regarding Broadcom copyright header 2018-05-08 01:03:16 -04:00
lpfc_debugfs.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_disc.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_els.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_hbadisc.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_hw4.h scsi: lpfc: Support duration field in Link Cable Beacon V1 command 2018-07-10 22:15:09 -04:00
lpfc_hw.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_ids.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_init.c scsi: lpfc: Support duration field in Link Cable Beacon V1 command 2018-07-10 22:15:09 -04:00
lpfc_logmsg.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_mbox.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_mem.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nl.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nportdisc.c scsi: lpfc: Fix ELS abort on SLI-3 adapters 2018-08-02 15:45:18 -04:00
lpfc_nvme.c scsi: lpfc: Fix driver crash when re-registering NVME rports. 2018-08-02 15:45:19 -04:00
lpfc_nvme.h scsi: lpfc: Comment cleanup regarding Broadcom copyright header 2018-05-08 01:03:16 -04:00
lpfc_nvmet.c scsi: lpfc: remove null check on nvmebuf 2018-07-30 23:17:53 -04:00
lpfc_nvmet.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_scsi.c scsi: lpfc: Fix list corruption on the completion queue. 2018-08-02 15:45:18 -04:00
lpfc_scsi.h scsi: lpfc: Comment cleanup regarding Broadcom copyright header 2018-05-08 01:03:16 -04:00
lpfc_sli4.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_sli.c scsi: lpfc: Fix ELS abort on SLI-3 adapters 2018-08-02 15:45:18 -04:00
lpfc_sli.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_version.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_vport.c scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_vport.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
Makefile scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00