Re: [PATCH 1/1] posix clocks: introduce syscall for clock tuning.

From: Bert Wesarg
Date: Mon Aug 23 2010 - 04:25:45 EST


On Mon, Aug 23, 2010 at 10:16, Richard Cochran <richardcochran@xxxxxxxxx> wrote:
> diff --git a/kernel/compat.c b/kernel/compat.c
> index 5adab05..df1e469 100644
> --- a/kernel/compat.c
> +++ b/kernel/compat.c
> @@ -628,6 +628,26 @@ long compat_sys_clock_gettime(clockid_t which_clock,
> Â Â Â Âreturn err;
> Â}
>
> +long compat_sys_clock_adjtime(clockid_t which_clock, int ppb,
> + Â Â Â Â Â Â Â struct compat_timespec __user *tp)
> +{
> + Â Â Â long err;
> + Â Â Â mm_segment_t oldfs;
> + Â Â Â struct timespec ts, *ptr = NULL;

Shouldn't ptr be initialized with tp?

> +
> + Â Â Â if (tp) {
> + Â Â Â Â Â Â Â if (get_compat_timespec(&ts, tp))
> + Â Â Â Â Â Â Â Â Â Â Â return -EFAULT;
> + Â Â Â Â Â Â Â ptr = &ts;
> + Â Â Â }
> + Â Â Â oldfs = get_fs();
> + Â Â Â set_fs(KERNEL_DS);
> + Â Â Â err = sys_clock_adjtime(which_clock, ppb,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (struct timespec __user *) ptr);
> + Â Â Â set_fs(oldfs);
> + Â Â Â return err;
> +}
> +
> Âlong compat_sys_clock_getres(clockid_t which_clock,
> Â Â Â Â Â Â Â Âstruct compat_timespec __user *tp)
> Â{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/