Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44332f7167dfb1ca04af96a2cff938c5e23433db
Commit:     44332f7167dfb1ca04af96a2cff938c5e23433db
Parent:     6e800af233e0bdf108efb7bd23c11ea6fa34cdeb
Author:     Anthony Liguori <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 7 16:31:52 2007 +1100
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Mon Nov 12 13:55:12 2007 +1100

    virtio: fix vring_init for 64 bits
    
    This patch fixes a typo in vring_init().  This happens to work today in 
lguest
    because the sizeof(struct vring_desc) is 16 and struct vring contains 3
    pointers and an unsigned int so on 32-bit
    sizeof(struct vring_desc) == sizeof(struct vring).  However, this is no 
longer
    true on 64-bit where the bug is exposed.
    
    Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
 include/linux/virtio_ring.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index ac69e7b..5b88d21 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -92,8 +92,8 @@ static inline void vring_init(struct vring *vr, unsigned int 
num, void *p)
 {
        vr->num = num;
        vr->desc = p;
-       vr->avail = p + num*sizeof(struct vring);
-       vr->used = p + (num+1)*(sizeof(struct vring) + sizeof(__u16));
+       vr->avail = p + num*sizeof(struct vring_desc);
+       vr->used = p + (num+1)*(sizeof(struct vring_desc) + sizeof(__u16));
 }
 
 static inline unsigned vring_size(unsigned int num)
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to