aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-04-18 14:43:36 +0900
committerRiku Voipio <riku.voipio@iki.fi>2011-05-02 10:00:01 +0300
commitcd18f05e248bb916028021634058da06a4657e26 (patch)
tree7f4421f3ba84fb35993b1e84ec4b8d36fa98b986 /linux-user
parente95d3bf04d8a54af43bb8db3b8eb64d68c9f6927 (diff)
Don't zero out buffer in sched_getaffinity
The kernel doesn't fill the buffer provided to sched_getaffinity with zero bytes, so neither should QEMU. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5b7b8e2394..279cef3cd4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6500,20 +6500,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
if (!is_error(ret)) {
- if (arg2 > ret) {
- /* Zero out any extra space kernel didn't fill */
- unsigned long zero = arg2 - ret;
- p = alloca(zero);
- memset(p, 0, zero);
- if (copy_to_user(arg3 + ret, p, zero)) {
- goto efault;
- }
- arg2 = ret;
- }
- if (copy_to_user(arg3, mask, arg2)) {
+ if (copy_to_user(arg3, mask, ret)) {
goto efault;
}
- ret = arg2;
}
}
break;