From: Miroslav Lichvar <mlichvar@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Richard Cochran <richardcochran@gmail.com>,
Miroslav Lichvar <mlichvar@redhat.com>
Subject: [PATCH] posix-timers: Fix clock_adjtime to return timex data on success
Date: Thu, 10 Jan 2013 18:12:02 +0100 [thread overview]
Message-ID: <1357837922-1555-1-git-send-email-mlichvar@redhat.com> (raw)
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>
---
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
next reply other threads:[~2013-01-10 17:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 17:12 Miroslav Lichvar [this message]
2013-01-10 20:12 ` Richard Cochran
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=1357837922-1555-1-git-send-email-mlichvar@redhat.com \
--to=mlichvar@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=richardcochran@gmail.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
all inboxes | Powered by JetHome®