Commit:     1bc4953ed44454c7f53d0b609445d1534981ee75
Parent:     4d125de3a5d130054df2285e542c1491d214d3e8
Author:     Anthony Liguori <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 7 15:49:24 2007 -0600
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Mon Nov 12 13:59:09 2007 +1100

    virtio: Fix used_idx wrap-around
    The more_used() function compares the vq->vring.used->idx with 
    Since vq->vring.used->idx is a 16-bit integer, and last_used_idx is an
    unsigned int, this results in unpredictable behavior when 
    wraps around.
    This patch corrects this by changing last_used_idx to the correct type.
    Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
 drivers/virtio/virtio_ring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 0e4baca..0e1bf05 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -53,7 +53,7 @@ struct vring_virtqueue
        unsigned int num_added;
        /* Last used index we've seen. */
-       unsigned int last_used_idx;
+       u16 last_used_idx;
        /* How to notify other side. FIXME: commonalize hcalls! */
        void (*notify)(struct virtqueue *vq);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to