Skip to content

Commit

Permalink
xenbus_client.c: correct exit path for xenbus_map_ring_valloc_hvm
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Liu authored and Konrad Rzeszutek Wilk committed May 29, 2013
1 parent d69c0e3 commit 8d0b880
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/xen/xenbus/xenbus_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 8d0b880

Please sign in to comment.