Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[linux-2.6-microblaze.git] / drivers / infiniband / ulp / srpt / ib_srpt.c
index 6be60aa..ea44780 100644 (file)
@@ -1528,16 +1528,20 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
                goto busy;
        }
 
-       rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
-                              &send_ioctx->sense_data[0],
-                              scsilun_to_int(&srp_cmd->lun), data_len,
-                              TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF,
-                              sg, sg_cnt, NULL, 0, NULL, 0);
+       rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0],
+                            scsilun_to_int(&srp_cmd->lun), data_len,
+                            TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
        if (rc != 0) {
                pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
                         srp_cmd->tag);
                goto busy;
        }
+
+       if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0,
+                              GFP_KERNEL))
+               return;
+
+       target_submit(cmd);
        return;
 
 busy:
@@ -2378,6 +2382,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
                pr_info("rejected SRP_LOGIN_REQ because target %s_%d is not enabled\n",
                        dev_name(&sdev->device->dev), port_num);
                mutex_unlock(&sport->mutex);
+               ret = -EINVAL;
                goto reject;
        }
 
@@ -3105,7 +3110,8 @@ static int srpt_add_one(struct ib_device *device)
 {
        struct srpt_device *sdev;
        struct srpt_port *sport;
-       int i, ret;
+       int ret;
+       u32 i;
 
        pr_debug("device = %p\n", device);