aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/scsi.c')
-rw-r--r--drivers/vhost/scsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 0a025b8e2a12..e48d4a672580 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1001,6 +1001,12 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
1001 break; 1001 break;
1002 } 1002 }
1003 1003
1004 /* virtio-scsi spec requires byte 0 of the lun to be 1 */
1005 if (unlikely(v_req.lun[0] != 1)) {
1006 vhost_scsi_send_bad_target(vs, vq, head, out);
1007 continue;
1008 }
1009
1004 /* Extract the tpgt */ 1010 /* Extract the tpgt */
1005 target = v_req.lun[1]; 1011 target = v_req.lun[1];
1006 tpg = ACCESS_ONCE(vs_tpg[target]); 1012 tpg = ACCESS_ONCE(vs_tpg[target]);