Commit ec2d7208 authored by Roland Dreier's avatar Roland Dreier

IB/srp: Get rid of extra scsi_host_put()s if reconnection fails

If a reconnection attempt fails, then SRP does two scsi_host_put()s.
This is a historical relic from an earlier version of the driver that
took a reference on the scsi_host before trying to reconnect, so get
rid of the extra scsi_host_put().
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent e6581056
...@@ -354,7 +354,6 @@ static void srp_remove_work(void *target_ptr) ...@@ -354,7 +354,6 @@ static void srp_remove_work(void *target_ptr)
spin_lock_irq(target->scsi_host->host_lock); spin_lock_irq(target->scsi_host->host_lock);
if (target->state != SRP_TARGET_DEAD) { if (target->state != SRP_TARGET_DEAD) {
spin_unlock_irq(target->scsi_host->host_lock); spin_unlock_irq(target->scsi_host->host_lock);
scsi_host_put(target->scsi_host);
return; return;
} }
target->state = SRP_TARGET_REMOVED; target->state = SRP_TARGET_REMOVED;
...@@ -368,8 +367,6 @@ static void srp_remove_work(void *target_ptr) ...@@ -368,8 +367,6 @@ static void srp_remove_work(void *target_ptr)
ib_destroy_cm_id(target->cm_id); ib_destroy_cm_id(target->cm_id);
srp_free_target_ib(target); srp_free_target_ib(target);
scsi_host_put(target->scsi_host); scsi_host_put(target->scsi_host);
/* And another put to really free the target port... */
scsi_host_put(target->scsi_host);
} }
static int srp_connect_target(struct srp_target_port *target) static int srp_connect_target(struct srp_target_port *target)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment