public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Miroslav Lichvar <mlichvar@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH] posix-timers: Fix clock_adjtime to return timex data on success
Date: Thu, 10 Jan 2013 21:12:07 +0100	[thread overview]
Message-ID: <20130110201205.GE2909@netboy.at.omicron.at> (raw)
In-Reply-To: <1357837922-1555-1-git-send-email-mlichvar@redhat.com>

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
> 

  reply	other threads:[~2013-01-10 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 17:12 [PATCH] posix-timers: Fix clock_adjtime to return timex data on success Miroslav Lichvar
2013-01-10 20:12 ` Richard Cochran [this message]
2013-01-10 20:27   ` John Stultz
2013-01-11 10:58     ` [PATCHv2] posix-timers: Fix clock_adjtime to always " Miroslav Lichvar
2013-01-12  2:29       ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130110201205.GE2909@netboy.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox