|
@@ -228,9 +228,12 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
|
|
u64 remote_wwnn)
|
|
u64 remote_wwnn)
|
|
{
|
|
{
|
|
mutex_lock(&lport->disc.disc_mutex);
|
|
mutex_lock(&lport->disc.disc_mutex);
|
|
- if (lport->ptp_rdata)
|
|
|
|
|
|
+ if (lport->ptp_rdata) {
|
|
lport->tt.rport_logoff(lport->ptp_rdata);
|
|
lport->tt.rport_logoff(lport->ptp_rdata);
|
|
|
|
+ kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy);
|
|
|
|
+ }
|
|
lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid);
|
|
lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid);
|
|
|
|
+ kref_get(&lport->ptp_rdata->kref);
|
|
lport->ptp_rdata->ids.port_name = remote_wwpn;
|
|
lport->ptp_rdata->ids.port_name = remote_wwpn;
|
|
lport->ptp_rdata->ids.node_name = remote_wwnn;
|
|
lport->ptp_rdata->ids.node_name = remote_wwnn;
|
|
mutex_unlock(&lport->disc.disc_mutex);
|
|
mutex_unlock(&lport->disc.disc_mutex);
|
|
@@ -947,7 +950,11 @@ static void fc_lport_reset_locked(struct fc_lport *lport)
|
|
if (lport->dns_rdata)
|
|
if (lport->dns_rdata)
|
|
lport->tt.rport_logoff(lport->dns_rdata);
|
|
lport->tt.rport_logoff(lport->dns_rdata);
|
|
|
|
|
|
- lport->ptp_rdata = NULL;
|
|
|
|
|
|
+ if (lport->ptp_rdata) {
|
|
|
|
+ lport->tt.rport_logoff(lport->ptp_rdata);
|
|
|
|
+ kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy);
|
|
|
|
+ lport->ptp_rdata = NULL;
|
|
|
|
+ }
|
|
|
|
|
|
lport->tt.disc_stop(lport);
|
|
lport->tt.disc_stop(lport);
|
|
|
|
|