xen/xenbus: Don't leak memory when unmapping the ring on HVM backend

The commit ccc9d90a9a "xenbus_client:
Extend interface to support multi-page ring" removes the call to
free_xenballooned_pages() in xenbus_unmap_ring_vfree_hvm(), leaking a
page for every shared ring.

Only with backends running in HVM domains were affected.

Signed-off-by: Julien Grall <[email protected]>
Cc: <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Reviewed-by: Wei Liu <[email protected]>
Signed-off-by: David Vrabel <[email protected]>
This commit is contained in:
Julien Grall 2015-08-10 19:10:38 +01:00 • committed by David Vrabel
commit c22fe519e7

View file

@ -814,8 +814,10 @@ static int xenbus_unmap_ring_vfree_hvm(struct xenbus_device *dev, void *vaddr)
rv = xenbus_unmap_ring(dev, node->handles, node->nr_handles,
addrs);
if (!rv)
if (!rv) {
vunmap(vaddr);
free_xenballooned_pages(node->nr_handles, node->hvm.pages);
}
else
WARN(1, "Leaking %p, size %u page(s)\n", vaddr,
node->nr_handles);