Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362497
b: refs/heads/master
c: 055f648
h: refs/heads/master
i:
  362495: e1a0a1e
v: v3
  • Loading branch information
Asias He authored and Nicholas Bellinger committed Apr 11, 2013
1 parent 3ccb5f7 commit 1af5c05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 637ab21e284f4e9188acc2746695f7f6452b4a22
refs/heads/master: 055f648c49d948de9452b0f1758869bbbd0097b8
10 changes: 6 additions & 4 deletions trunk/drivers/vhost/tcm_vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs,
if (IS_ERR(tv_cmd)) {
vq_err(vq, "vhost_scsi_allocate_cmd failed %ld\n",
PTR_ERR(tv_cmd));
break;
goto err_cmd;
}
pr_debug("Allocated tv_cmd: %p exp_data_len: %d, data_direction"
": %d\n", tv_cmd, exp_data_len, data_direction);
Expand All @@ -729,7 +729,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs,
" exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n",
scsi_command_size(tv_cmd->tvc_cdb),
TCM_VHOST_MAX_CDB_SIZE);
goto err;
goto err_free;
}
tv_cmd->tvc_lun = ((v_req.lun[2] << 8) | v_req.lun[3]) & 0x3FFF;

Expand All @@ -742,7 +742,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs,
data_direction == DMA_TO_DEVICE);
if (unlikely(ret)) {
vq_err(vq, "Failed to map iov to sgl\n");
goto err;
goto err_free;
}
}

Expand All @@ -765,8 +765,10 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs,
mutex_unlock(&vq->mutex);
return;

err:
err_free:
vhost_scsi_free_cmd(tv_cmd);
err_cmd:
vhost_scsi_send_bad_target(vs, vq, head, out);
mutex_unlock(&vq->mutex);
}

Expand Down

0 comments on commit 1af5c05

Please sign in to comment.