diff mbox

[PULL,v2,17/23] linux-user: Detect fault in sched_rr_get_interval

Message ID 4f1e99a9aac7ff88a4fe034f545184d0e3380a4b.1408436940.git.riku.voipio@linaro.org
State Superseded
Headers show

Commit Message

Riku Voipio Aug. 19, 2014, 8:32 a.m. UTC
From: Tom Musta <tommusta@gmail.com>

Properly detect a fault when attempting to store into an invalid
struct timespec pointer.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a0436da..a24356d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7864,7 +7864,7 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             struct timespec ts;
             ret = get_errno(sched_rr_get_interval(arg1, &ts));
             if (!is_error(ret)) {
-                host_to_target_timespec(arg2, &ts);
+                ret = host_to_target_timespec(arg2, &ts);
             }
         }
         break;