diff options
author | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2012-09-06 13:24:39 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-06 16:14:36 -0400 |
commit | 1714df7f2cee6a741c3ed24231ec5db25b90633a (patch) | |
tree | e86ef69a2568aae9ef0033fdb53f2cde738db9d8 /drivers/xen | |
parent | ceb90fa0a8008059ecbbf9114cb89dc71a730bb6 (diff) | |
download | linux-1714df7f2cee6a741c3ed24231ec5db25b90633a.tar.bz2 |
xen/privcmd: Fix mmap batch ioctl error status copy back.
Copy back of per-slot error codes is only necessary for V2. V1 does not provide
an error array, so copyback will unconditionally set the global rc to EFAULT.
Only copyback for V2.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/privcmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 92a285b1b96a..3b162c656205 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -389,7 +389,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version) state.err = err_array; ret = traverse_pages(m.num, sizeof(xen_pfn_t), &pagelist, mmap_return_errors_v1, &state); - } else + } else if (version == 2) ret = __copy_to_user(m.err, err_array, m.num * sizeof(int)); /* If we have not had any EFAULT-like global errors then set the global |