aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2015-05-18 07:23:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-21 13:10:04 -0400
commit5e72c7cc287d9415debd623e96ac275f20d37645 (patch)
tree50b7642253790d7d85cbf5b2d25a1499ea4cd79d
parent3646ac368739a302008cc7bf33a985da2cfa1a17 (diff)
IB/srp: Remove an extraneous scsi_host_put() from an error path
commit fb49c8bbaae70b14fea2b4590a90a21539f88526 upstream. Fix a scsi_get_host() / scsi_host_put() imbalance in the error path of srp_create_target(). See also patch "IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning" (commit ID 34aa654ecb8e). Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 918814cd0f80..5ce6cfd86476 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3172,11 +3172,11 @@ static ssize_t srp_create_target(struct device *dev,
3172 3172
3173 ret = srp_parse_options(buf, target); 3173 ret = srp_parse_options(buf, target);
3174 if (ret) 3174 if (ret)
3175 goto err; 3175 goto out;
3176 3176
3177 ret = scsi_init_shared_tag_map(target_host, target_host->can_queue); 3177 ret = scsi_init_shared_tag_map(target_host, target_host->can_queue);
3178 if (ret) 3178 if (ret)
3179 goto err; 3179 goto out;
3180 3180
3181 target->req_ring_size = target->queue_size - SRP_TSK_MGMT_SQ_SIZE; 3181 target->req_ring_size = target->queue_size - SRP_TSK_MGMT_SQ_SIZE;
3182 3182
@@ -3187,7 +3187,7 @@ static ssize_t srp_create_target(struct device *dev,
3187 be64_to_cpu(target->ioc_guid), 3187 be64_to_cpu(target->ioc_guid),
3188 be64_to_cpu(target->initiator_ext)); 3188 be64_to_cpu(target->initiator_ext));
3189 ret = -EEXIST; 3189 ret = -EEXIST;
3190 goto err; 3190 goto out;
3191 } 3191 }
3192 3192
3193 if (!srp_dev->has_fmr && !srp_dev->has_fr && !target->allow_ext_sg && 3193 if (!srp_dev->has_fmr && !srp_dev->has_fr && !target->allow_ext_sg &&
@@ -3208,7 +3208,7 @@ static ssize_t srp_create_target(struct device *dev,
3208 spin_lock_init(&target->lock); 3208 spin_lock_init(&target->lock);
3209 ret = ib_query_gid(ibdev, host->port, 0, &target->sgid); 3209 ret = ib_query_gid(ibdev, host->port, 0, &target->sgid);
3210 if (ret) 3210 if (ret)
3211 goto err; 3211 goto out;
3212 3212
3213 ret = -ENOMEM; 3213 ret = -ENOMEM;
3214 target->ch_count = max_t(unsigned, num_online_nodes(), 3214 target->ch_count = max_t(unsigned, num_online_nodes(),
@@ -3219,7 +3219,7 @@ static ssize_t srp_create_target(struct device *dev,
3219 target->ch = kcalloc(target->ch_count, sizeof(*target->ch), 3219 target->ch = kcalloc(target->ch_count, sizeof(*target->ch),
3220 GFP_KERNEL); 3220 GFP_KERNEL);
3221 if (!target->ch) 3221 if (!target->ch)
3222 goto err; 3222 goto out;
3223 3223
3224 node_idx = 0; 3224 node_idx = 0;
3225 for_each_online_node(node) { 3225 for_each_online_node(node) {
@@ -3315,9 +3315,6 @@ err_disconnect:
3315 } 3315 }
3316 3316
3317 kfree(target->ch); 3317 kfree(target->ch);
3318
3319err:
3320 scsi_host_put(target_host);
3321 goto out; 3318 goto out;
3322} 3319}
3323 3320