]> git.baikalelectronics.ru Git - kernel.git/commit
tty: fix return value for unsupported termiox ioctls
authorJohan Hovold <johan@kernel.org>
Wed, 7 Apr 2021 09:52:03 +0000 (11:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Apr 2021 08:36:34 +0000 (10:36 +0200)
commit5163ea103ac85b277b405ec869f86f272ee953b1
tree4089dbd383d38c527d8767d052ba33d3581700a2
parentaa24064ff1581df5cde5910d9b3d7a07a7120e14
tty: fix return value for unsupported termiox ioctls

Drivers should return -ENOTTY ("Inappropriate I/O control operation")
when an ioctl isn't supported, while -EINVAL is used for invalid
arguments.

Support for termiox was added by commit fbacee6fafde ("tty: Add
termiox") in 2008 but no driver support ever followed and it was
recently ripped out by commit 0317dae446f3 ("tty: Remove dead termiox
code").

Fix the return value for the unsupported termiox ioctls, which have
always returned -EINVAL, by explicitly returning -ENOTTY rather than
removing them completely and falling back to the default unrecognised-
ioctl handling.

Fixes: fbacee6fafde ("tty: Add termiox")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407095208.31838-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ioctl.c