# HG changeset patch # User Brendan Cully # Date 1264023273 28800 # Node ID fe58c98dd43f370b5461e3ad451b2520dd6b9e2e # Parent b0b41e735575ec6fc1d7d56f3cffa9246058881a xc_map_foreign_bulk: unconditionally prezero error array MMAPBATCH_V2 does not touch the array unless a mapping fails, so it is up to the caller to zero it before making the ioctl. Signed-off-by: Brendan Cully diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c --- a/tools/libxc/xc_linux.c +++ b/tools/libxc/xc_linux.c @@ -159,6 +159,9 @@ ioctlx.arr = arr; ioctlx.err = err; + if (num > 0) + memset(err, 0, sizeof(*err) * num); + rc = ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx); if ( rc < 0 && errno == ENOENT )