]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_balloon: Fix endian bug
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 12 Apr 2012 05:36:34 +0000 (15:36 +1000)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 15 Apr 2012 08:51:05 +0000 (11:51 +0300)
commit9e4d300dbe1f78b8973520a106c111194979ecca
tree3c852fe87074cdc40a3435e3c18233be3b3f23e3
parentdb671b6d721bceb9719f8fe0b1162063f34775b5
virtio_balloon: Fix endian bug

Although virtio config space fields are usually in guest-native endian,
the spec for the virtio balloon device explicitly states that both fields
in its config space are little-endian.

However, the current virtio_balloon driver does not have a suitable endian
swap for the 'num_pages' field, although it does have one for the 'actual'
field.  This patch corrects the bug, adding sparse annotation while we're
at it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_balloon.c