Skip to content

Commit

Permalink
xen/privcmd: Fix mmap batch ioctl error status copy back.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andres Lagar-Cavilla authored and Konrad Rzeszutek Wilk committed Sep 6, 2012
1 parent ceb90fa commit 1714df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/privcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1714df7

Please sign in to comment.