]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: only allow phase values lower than 1 period
authorVladimir Oltean <olteanv@gmail.com>
Wed, 5 Aug 2020 00:10:47 +0000 (03:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Aug 2020 19:06:44 +0000 (12:06 -0700)
commitc3cf76db75c0a3051c0967e3915ce3c5a6a33078
tree282a9f364a184ad6e776861d7bba5b3594a87687
parentf6c61ec34e2da45d074fd0fdd2c07baef29dc1a5
ptp: only allow phase values lower than 1 period

The way we define the phase (the difference between the time of the
signal's rising edge, and the closest integer multiple of the period),
it doesn't make sense to have a phase value equal or larger than 1
period.

So deny these settings coming from the user.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_chardev.c