public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-arch@vger.kernel.org
Subject: compat_clock_getres shouldn't return -EFAULT if res == NULL
Date: Mon, 26 Jul 2004 12:51:29 -0700	[thread overview]
Message-ID: <410560C1.1060804@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 41 bytes --]


Description within the patch.

	-Arun



[-- Attachment #2: compat-clock-res.patch --]
[-- Type: text/plain, Size: 765 bytes --]

For clock_getres(clockid_t clock_id, struct timespec *res), the
specification says "If res is NULL, the clock resolution is not
returned." So this kind of call should succeed. The current implementation
returns -EFAULT.

The patch fixes the bug in compat_clock_getres().

Signed-off-by: Gordon Jin <gordon.jin@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

--- linux-2.6.7/kernel/compat.c.orig	2004-07-25 09:02:01.000000000 -0700
+++ linux-2.6.7/kernel/compat.c	2004-07-25 09:04:51.000000000 -0700
@@ -531,7 +531,7 @@
 	err = sys_clock_getres(which_clock,
 			       (struct timespec __user *) &ts);
 	set_fs(oldfs);
-	if (!err && put_compat_timespec(&ts, tp))
+	if (!err && tp && put_compat_timespec(&ts, tp))
 		return -EFAULT; 
 	return err;
 } 

             reply	other threads:[~2004-07-26 19:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26 19:51 Arun Sharma [this message]
2004-07-26 19:55 ` compat_clock_getres shouldn't return -EFAULT if res == NULL David S. Miller
2004-07-26 20:36   ` Andrew Morton

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=410560C1.1060804@intel.com \
    --to=arun.sharma@intel.com \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    /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