From: Tom Musta <tommu...@gmail.com>

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

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

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4424b63..ed32f97 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7794,7 +7794,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;
-- 
2.0.1


Reply via email to