]> git.baikalelectronics.ru Git - kernel.git/commit
serial: core: sanitize RS485 delays read from device tree
authorLino Sanfilippo <l.sanfilippo@kunbus.com>
Sun, 10 Jul 2022 16:44:39 +0000 (18:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Jul 2022 14:34:24 +0000 (16:34 +0200)
commit192fe67ff8c5dfda0904f07576760ea7cb362446
treeb5751584c12b79e884c95b4b941bfd05ca66db28
parent575ee434fa71ad040c8f4de18efb541c8b0e5c0b
serial: core: sanitize RS485 delays read from device tree

Currently the RTS delays set via device tree are not clamped to a maximum
value although the device tree bindings documentation for RS485 claims that
only a maximum of 1000 msecs is allowed.

So clamp the values to avoid arbitrary high delay settings. However clamp
the values to 100 instead of 1000 msecs to be consistent which the maximum
that is allowed when setting the delays from userspace via the UART ioctl
TIOCSRS485.

Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20220710164442.2958979-6-LinoSanfilippo@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c