]> git.proxmox.com Git - qemu.git/commit
virtio-net: Fix lduw_p() pointer argument of wrong size
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 3 Mar 2011 21:42:28 +0000 (21:42 +0000)
committerAurelien Jarno <aurelien@aurel32.net>
Thu, 3 Mar 2011 22:46:18 +0000 (23:46 +0100)
commit4b35dfea68539b9737749bf0e70a9dd4d253544c
tree75631e27c83cb328e191d5098a61bf0b51685947
parentcdd8152e56422d37e0d38454552bac5bc8ce4838
virtio-net: Fix lduw_p() pointer argument of wrong size

A pointer to a size_t variable was passed as the void * pointer to
lduw_p() in virtio_net_receive().  Instead of acting on the 16-bit value
this caused failure on big-endian hosts.

Avoid this issue in the future by using stw_p() instead.  In general we
should use ld*_p() for loading from target memory and st*_p() for
storing to target memory anyway, not the other way around.

Also tighten up a correct use of lduw_p() when stw_p() should be used
instead in virtio_net_get_config().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit b46d97f2d2fd7c099b11e610de630918dfd11fa1)
hw/virtio-net.c