Skip to content

Commit 295c1b9

Browse files
committed
vhost/scsi: fix up req type endian-ness
vhost/scsi doesn't handle type conversion correctly for request type when using virtio 1.0 and up for BE, or cross-endian platforms. Fix it up using vhost_32_to_cpu. Cc: [email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]>
1 parent fe3c606 commit 295c1b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vhost/scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
12151215
continue;
12161216
}
12171217

1218-
switch (v_req.type) {
1218+
switch (vhost32_to_cpu(vq, v_req.type)) {
12191219
case VIRTIO_SCSI_T_TMF:
12201220
vc.req = &v_req.tmf;
12211221
vc.req_size = sizeof(struct virtio_scsi_ctrl_tmf_req);

0 commit comments

Comments
 (0)