diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 489bfc61cf30001626307f4e2f936d2e65cdeb73..d2863c321e93e00fc896ba529bd6a8c6f0ed6acb 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, if (i == err_idx) break; vring_unmap_one(vq, &desc[i]); - i = vq->vring.desc[i].next; + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); } vq->vq.num_free += total_sg; @@ -601,7 +601,7 @@ EXPORT_SYMBOL_GPL(virtqueue_kick); static void detach_buf(struct vring_virtqueue *vq, unsigned int head) { unsigned int i, j; - u16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT); + __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT); /* Clear data ptr. */ vq->desc_state[head].data = NULL;