[PATCH] virtio_config: fix len calculation of config elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rusty,

This patch is a prereq for the virtio_blk blocksize patch, please apply it 
first.

Adding an u32 value to the virtio_blk_config unconvered a small bug the config 
space defintions:
v is a pointer, to we have to use sizeof(*v) instead of sizeof(v).

Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
---
 include/linux/virtio_config.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: kvm/include/linux/virtio_config.h
===================================================================
--- kvm.orig/include/linux/virtio_config.h
+++ kvm/include/linux/virtio_config.h
@@ -99,7 +99,7 @@ static inline bool virtio_has_feature(co
  * The return value is -ENOENT if the feature doesn't exist.  Otherwise
  * the config value is copied into whatever is pointed to by v. */
 #define virtio_config_val(vdev, fbit, offset, v) \
-	virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(v))
+	virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))
 
 static inline int virtio_config_buf(struct virtio_device *vdev,
 				    unsigned int fbit,
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux