Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3309daaad724dd08eb598bf9c12b7bb9daddd706
Commit:     3309daaad724dd08eb598bf9c12b7bb9daddd706
Parent:     f957d1f05a1a20bc3b954877c6562a4d53d58bde
Author:     Anthony Liguori <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 21 02:17:47 2007 +0200
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 23:49:59 2008 +1100

    virtio: Fix vring_init/vring_size to take unsigned long
    
    Using unsigned int resulted in silent truncation of the upper 32-bit
    on x86_64 resulting in an OOPS since the ring was being initialized
    wrong.
    
    Please reconsider my previous patch to just use PAGE_ALIGN().  Open
    coding this sort of stuff, no matter how simple it seems, is just
    asking for this sort of trouble.
    
    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 8cde10e..ea3be89 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -89,7 +89,7 @@ struct vring {
  * };
  */
 static inline void vring_init(struct vring *vr, unsigned int num, void *p,
-                             unsigned int pagesize)
+                             unsigned long pagesize)
 {
        vr->num = num;
        vr->desc = p;
@@ -98,7 +98,7 @@ static inline void vring_init(struct vring *vr, unsigned int 
num, void *p,
                            & ~(pagesize - 1));
 }
 
-static inline unsigned vring_size(unsigned int num, unsigned int pagesize)
+static inline unsigned vring_size(unsigned int num, unsigned long pagesize)
 {
        return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
                 + pagesize - 1) & ~(pagesize - 1))
-
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