summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-02-25 10:27:40 +0000
committerAurelien Jarno <aurelien@aurel32.net>2011-03-22 07:46:21 +0100
commit30cb4cdec79dc2727f562edee36a4f3df4dfc23f (patch)
tree24e9f3d2f7a9e663a094408ffbb7a5a2b83434c8 /linux-user
parentff90d50393e4485e336ec57e157eee0f5d116d91 (diff)
linux-user: Fix unlock_user() call in return from poll()
Correct the broken attempt to calculate the third argument to unlock_user() in the code path which unlocked the pollfd array on return from poll() and ppoll() emulation. (This only caused a problem if unlock_user() wasn't a no-op, eg if DEBUG_REMAP is defined.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 23d7a630f..bb0999d1a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6318,10 +6318,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
for(i = 0; i < nfds; i++) {
target_pfd[i].revents = tswap16(pfd[i].revents);
}
- ret += nfds * (sizeof(struct target_pollfd)
- - sizeof(struct pollfd));
}
- unlock_user(target_pfd, arg1, ret);
+ unlock_user(target_pfd, arg1, sizeof(struct target_pollfd) * nfds);
}
break;
#endif