From: Arun Sharma 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 Signed-off-by: Arun Sharma Signed-off-by: Andrew Morton --- 25-akpm/kernel/compat.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/compat.c~compat_clock_getres-shouldnt-return-efault-if-res-==-null kernel/compat.c --- 25/kernel/compat.c~compat_clock_getres-shouldnt-return-efault-if-res-==-null 2004-07-26 22:26:12.848485744 -0700 +++ 25-akpm/kernel/compat.c 2004-07-26 22:26:12.852485136 -0700 @@ -531,7 +531,7 @@ long compat_clock_getres(clockid_t which 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; } _