Re: [PATCH] ptp: Limit time setting of PTP clocks
From: Richard Cochran
Date: Mon Sep 09 2024 - 11:48:35 EST
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index c56cd0f63909..bd7c5f534be6 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -100,6 +100,9 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec64 *tp
> return -EBUSY;
> }
>
> + if (!timespec64_valid_settod(tp))
> + return -EINVAL;
Why not perform the test earlier, in SYSCALL_DEFINE2(clock_settime, ...) ?
Thanks,
Richard