]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-balloon: free pbp more aggressively
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 25 Jul 2019 11:54:25 +0000 (07:54 -0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 30 Jul 2019 17:46:52 +0000 (12:46 -0500)
commitc6b77a64b4af9ad2efe5dd68047f1f0bd256d5fc
tree73c90c81eaf75eb65ed133ad83f1bd6ff43e7d36
parent0965d5583ee6cf94f8232a2582cd7b5e74a6ea7d
virtio-balloon: free pbp more aggressively

Previous patches switched to a temporary pbp but that does not go far
enough: after device uses a buffer, guest is free to reuse it, so
tracking the page and freeing it later is wrong.

Free and reset the pbp after we push each element.

Fixes: ed48c59875b6 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size")
Cc: qemu-stable@nongnu.org #v4.0.0
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 1b47b37c33ec01ae1efc527f4c97f97f93723bc4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio-balloon.c