lkml.org 
[lkml]   [2013]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] posix-timers: Fix clock_adjtime to return timex data on success
On Thu, Jan 10, 2013 at 06:12:02PM +0100, Miroslav Lichvar wrote:
> Copy the modified timex data back to the user also with positive return
> values. This fixes reading of the CLOCK_REALTIME timex data when the
> clock is in a non-zero state.
>
> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>

Acked-by: Richard Cochran <richardcochran@gmail.com>

(Adding John Stultz on CC)

> ---
> kernel/posix-timers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
> index 69185ae..10349d5 100644
> --- a/kernel/posix-timers.c
> +++ b/kernel/posix-timers.c
> @@ -997,7 +997,7 @@ SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock,
>
> err = kc->clock_adj(which_clock, &ktx);
>
> - if (!err && copy_to_user(utx, &ktx, sizeof(ktx)))
> + if (err >= 0 && copy_to_user(utx, &ktx, sizeof(ktx)))
> return -EFAULT;
>
> return err;
> --
> 1.7.11.7
>


\
 
 \ /
  Last update: 2013-01-10 21:21    [W:0.058 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site