aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-01-22 10:59:51 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-01-22 10:59:51 +0000
commit7848a26a9729479720edfcee8c6bd816eb11ac41 (patch)
tree3e84286123405ec5b960d42950974fc7a3545837 /tools/libxc/xc_linux.c
parentd6aaa9ee0f8ba5d2d8ff1187b05ed9becee0b40c (diff)
downloadxen-7848a26a9729479720edfcee8c6bd816eb11ac41.tar.gz
xen-7848a26a9729479720edfcee8c6bd816eb11ac41.tar.bz2
xen-7848a26a9729479720edfcee8c6bd816eb11ac41.zip
libxc: mmapbatch-v2 adjustments
Just like the kernel, the fallback implementation of xc_map_foreign_bulk() should clear the error indication array upon success. Also, a few allocations were needlessly using calloc() instead of malloc(). Finally, in xc_domain_save() allocate the error indicator array once (along with the other arrays) instead of using realloc() (without error checking) in the loop body. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r--tools/libxc/xc_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 3f3bc10d95..55ceda1fcd 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -186,7 +186,7 @@ void *xc_map_foreign_bulk(int xc_handle, uint32_t dom, int prot,
* IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
* IOCTL_PRIVCMD_MMAPBATCH.
*/
- xen_pfn_t *pfn = calloc(num, sizeof(*pfn));
+ xen_pfn_t *pfn = malloc(num * sizeof(*pfn));
if ( pfn )
{