diff options
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index d126ecfff704..fe8700f4326a 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -228,9 +228,12 @@ static void fc_lport_ptp_setup(struct fc_lport *lport, | |||
228 | u64 remote_wwnn) | 228 | u64 remote_wwnn) |
229 | { | 229 | { |
230 | mutex_lock(&lport->disc.disc_mutex); | 230 | mutex_lock(&lport->disc.disc_mutex); |
231 | if (lport->ptp_rdata) | 231 | if (lport->ptp_rdata) { |
232 | lport->tt.rport_logoff(lport->ptp_rdata); | 232 | lport->tt.rport_logoff(lport->ptp_rdata); |
233 | kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy); | ||
234 | } | ||
233 | lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid); | 235 | lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid); |
236 | kref_get(&lport->ptp_rdata->kref); | ||
234 | lport->ptp_rdata->ids.port_name = remote_wwpn; | 237 | lport->ptp_rdata->ids.port_name = remote_wwpn; |
235 | lport->ptp_rdata->ids.node_name = remote_wwnn; | 238 | lport->ptp_rdata->ids.node_name = remote_wwnn; |
236 | mutex_unlock(&lport->disc.disc_mutex); | 239 | mutex_unlock(&lport->disc.disc_mutex); |
@@ -947,7 +950,11 @@ static void fc_lport_reset_locked(struct fc_lport *lport) | |||
947 | if (lport->dns_rdata) | 950 | if (lport->dns_rdata) |
948 | lport->tt.rport_logoff(lport->dns_rdata); | 951 | lport->tt.rport_logoff(lport->dns_rdata); |
949 | 952 | ||
950 | lport->ptp_rdata = NULL; | 953 | if (lport->ptp_rdata) { |
954 | lport->tt.rport_logoff(lport->ptp_rdata); | ||
955 | kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy); | ||
956 | lport->ptp_rdata = NULL; | ||
957 | } | ||
951 | 958 | ||
952 | lport->tt.disc_stop(lport); | 959 | lport->tt.disc_stop(lport); |
953 | 960 | ||