summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2013-05-29 20:02:58 +0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-29 23:24:55 +0400
commit8d0b8801c9e4c2c6b20cdac74dbab16facce7653 (patch)
tree4548c7791b1f9bec5675003aadf4b9970baec3ae /drivers
parentd69c0e3975e4955dd596c162d1628ba1dbb1eb45 (diff)
downloadlinux-8d0b8801c9e4c2c6b20cdac74dbab16facce7653.tar.xz
xenbus_client.c: correct exit path for xenbus_map_ring_valloc_hvm
Apparently we should not free page that has not been allocated. This is b/c alloc_xenballooned_pages will take care of freeing the page on its own. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/xenbus/xenbus_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 61786be9138b..ec097d6f964d 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -534,7 +534,7 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev,
err = xenbus_map_ring(dev, gnt_ref, &node->handle, addr);
if (err)
- goto out_err;
+ goto out_err_free_ballooned_pages;
spin_lock(&xenbus_valloc_lock);
list_add(&node->next, &xenbus_valloc_pages);
@@ -543,8 +543,9 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev,
*vaddr = addr;
return 0;
- out_err:
+ out_err_free_ballooned_pages:
free_xenballooned_pages(1, &node->page);
+ out_err:
kfree(node);
return err;
}