|
@@ -2725,7 +2725,9 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
|
|
|
rpinfo.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn);
|
|
|
rpinfo.node_name = wwn_to_u64(ndlp->nlp_nodename.u.wwn);
|
|
|
|
|
|
+ spin_lock_irq(&vport->phba->hbalock);
|
|
|
oldrport = lpfc_ndlp_get_nrport(ndlp);
|
|
|
+ spin_unlock_irq(&vport->phba->hbalock);
|
|
|
if (!oldrport)
|
|
|
lpfc_nlp_get(ndlp);
|
|
|
|
|
@@ -2840,7 +2842,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
|
|
|
struct nvme_fc_local_port *localport;
|
|
|
struct lpfc_nvme_lport *lport;
|
|
|
struct lpfc_nvme_rport *rport;
|
|
|
- struct nvme_fc_remote_port *remoteport;
|
|
|
+ struct nvme_fc_remote_port *remoteport = NULL;
|
|
|
|
|
|
localport = vport->localport;
|
|
|
|
|
@@ -2854,11 +2856,14 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
|
|
|
if (!lport)
|
|
|
goto input_err;
|
|
|
|
|
|
+ spin_lock_irq(&vport->phba->hbalock);
|
|
|
rport = lpfc_ndlp_get_nrport(ndlp);
|
|
|
- if (!rport)
|
|
|
+ if (rport)
|
|
|
+ remoteport = rport->remoteport;
|
|
|
+ spin_unlock_irq(&vport->phba->hbalock);
|
|
|
+ if (!remoteport)
|
|
|
goto input_err;
|
|
|
|
|
|
- remoteport = rport->remoteport;
|
|
|
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC,
|
|
|
"6033 Unreg nvme remoteport %p, portname x%llx, "
|
|
|
"port_id x%06x, portstate x%x port type x%x\n",
|