aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.c')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 4b62105ed1e8..b28c2b9db26b 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1132,15 +1132,12 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
1132 1132
1133 spin_lock_irqsave(&target->lock, flags); 1133 spin_lock_irqsave(&target->lock, flags);
1134 iu = __srp_get_tx_iu(target, SRP_IU_CMD); 1134 iu = __srp_get_tx_iu(target, SRP_IU_CMD);
1135 if (iu) {
1136 req = list_first_entry(&target->free_reqs, struct srp_request,
1137 list);
1138 list_del(&req->list);
1139 }
1140 spin_unlock_irqrestore(&target->lock, flags);
1141
1142 if (!iu) 1135 if (!iu)
1143 goto err; 1136 goto err_unlock;
1137
1138 req = list_first_entry(&target->free_reqs, struct srp_request, list);
1139 list_del(&req->list);
1140 spin_unlock_irqrestore(&target->lock, flags);
1144 1141
1145 dev = target->srp_host->srp_dev->dev; 1142 dev = target->srp_host->srp_dev->dev;
1146 ib_dma_sync_single_for_cpu(dev, iu->dma, srp_max_iu_len, 1143 ib_dma_sync_single_for_cpu(dev, iu->dma, srp_max_iu_len,
@@ -1185,6 +1182,8 @@ err_iu:
1185 1182
1186 spin_lock_irqsave(&target->lock, flags); 1183 spin_lock_irqsave(&target->lock, flags);
1187 list_add(&req->list, &target->free_reqs); 1184 list_add(&req->list, &target->free_reqs);
1185
1186err_unlock:
1188 spin_unlock_irqrestore(&target->lock, flags); 1187 spin_unlock_irqrestore(&target->lock, flags);
1189 1188
1190err: 1189err: