Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 1d65b4a088de ("tty: Add
termiox") in 2008 but no driver support ever followed and it was
recently ripped out by commit e0efb3168d34 ("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: 1d65b4a088de ("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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
8871de06 1b8b2086

+2 -2
+2 -2
drivers/tty/tty_ioctl.c
··· 773 773 case TCSETX: 774 774 case TCSETXW: 775 775 case TCSETXF: 776 - return -EINVAL; 777 - #endif 776 + return -ENOTTY; 777 + #endif 778 778 case TIOCGSOFTCAR: 779 779 copy_termios(real_tty, &kterm); 780 780 ret = put_user((kterm.c_cflag & CLOCAL) ? 1 : 0,