diff options
author | Johan Hovold <johan@kernel.org> | 2021-04-07 13:23:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-07 18:22:07 +0300 |
commit | bf510acbea476b7cc19419c0830b0367e7ec3a57 (patch) | |
tree | af2b9d849cf6d05326c1a8b1b654d2e072eb9912 | |
parent | dc8c8437658667be9b11ec25c4b5482ed2becdaa (diff) | |
download | linux-bf510acbea476b7cc19419c0830b0367e7ec3a57.tar.xz |
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>
-rw-r--r-- | drivers/tty/moxa.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 63e440d900ff..4d4f15b5cd29 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -2055,11 +2055,6 @@ static int moxa_set_serial_info(struct tty_struct *tty, if (!info) return -ENODEV; - if (ss->irq != 0 || ss->port != 0 || - ss->custom_divisor != 0 || - ss->baud_base != 921600) - return -EPERM; - close_delay = msecs_to_jiffies(ss->close_delay * 10); mutex_lock(&info->port.mutex); |