]> git.baikalelectronics.ru Git - kernel.git/commit
tty: moxa: fix TIOCSSERIAL implementation
authorJohan Hovold <johan@kernel.org>
Wed, 7 Apr 2021 10:23:30 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 15:22:07 +0000 (17:22 +0200)
commitcaf8dffc0de63898e2ea472367a886ac912a2a4b
treeaf2b9d849cf6d05326c1a8b1b654d2e072eb9912
parent7ecc206a3397ddc4809780902c22e6507efa7b2a
tty: moxa: fix TIOCSSERIAL implementation

TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

A non-privileged user has only ever been able to set the since long
deprecated ASYNC_SPD flags and trying to change any other *supported*
feature should result in -EPERM being returned. Setting the current
values for any supported features should return success.

Fix the moxa implementation which was returning -EPERM also for a
privileged user when trying to change certain unsupported parameters and
instead return success consistently.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407102334.32361-13-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/moxa.c