Commit 0cea71a2 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

virtio: don't mark unaccessed memory as dirty



offset of accessed buffer is calculated using iov_length, so it
can exceed accessed len. If that happens
math in len - offset wraps around, and size becomes wrong.
As real value is 0, so this is harmless but unnecessary.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 6f8fd253
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
                                  elem->in_sg[i].iov_len,
                                  1, size);

        offset += elem->in_sg[i].iov_len;
        offset += size;
    }

    for (i = 0; i < elem->out_num; i++)