mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
tty: fix return value for unsupported termiox ioctls
[ Upstream commit8871de06ff] 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 commit1d65b4a088("tty: Add termiox") in 2008 but no driver support ever followed and it was recently ripped out by commite0efb3168d("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:1d65b4a088("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
eef2158b0c
commit
1d9cde4ddf
|
|
@ -774,7 +774,7 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
|
||||||
case TCSETX:
|
case TCSETX:
|
||||||
case TCSETXW:
|
case TCSETXW:
|
||||||
case TCSETXF:
|
case TCSETXF:
|
||||||
return -EINVAL;
|
return -ENOTTY;
|
||||||
#endif
|
#endif
|
||||||
case TIOCGSOFTCAR:
|
case TIOCGSOFTCAR:
|
||||||
copy_termios(real_tty, &kterm);
|
copy_termios(real_tty, &kterm);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user