Commit 30cb4cde authored by Peter Maydell's avatar Peter Maydell Committed by Aurelien Jarno
Browse files

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: default avatarPeter Maydell <>
Signed-off-by: default avatarAurelien Jarno <>
parent ff90d503
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment