aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorArun Sharma <arun.sharma@intel.com>2004-07-28 08:57:26 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-28 08:57:26 -0700
commit09e77fcaff727d2454d1350330920184e9c8e65b (patch)
tree09bf5ae864f331db9e9bb4d0320fcf0db2a3b728 /kernel
parent396af5c123b282c532f164b9bf90a1c18fa07756 (diff)
downloadhistory-09e77fcaff727d2454d1350330920184e9c8e65b.tar.gz
[PATCH] compat_clock_getres shouldn't return -EFAULT if res == NULL
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/compat.c b/kernel/compat.c
index 57cc48e9036140..481ac0d4bb9848 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -531,7 +531,7 @@ long compat_clock_getres(clockid_t which_clock,
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;
}