mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 01:30:52 +07:00
drivers:tty:fix up ENOIOCTLCMD error handling
At commit 07d106d0
, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.
For example:
fd = open("/dev/tty", O_RDWR);
ioctl(fd, -1, &argp);
then the errno should be ENOTTY but not EINVAL.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fd7c81f864
commit
bbb63c514a
@ -2774,7 +2774,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
if (ld->ops->ioctl) {
|
||||
retval = ld->ops->ioctl(tty, file, cmd, arg);
|
||||
if (retval == -ENOIOCTLCMD)
|
||||
retval = -EINVAL;
|
||||
retval = -ENOTTY;
|
||||
}
|
||||
tty_ldisc_deref(ld);
|
||||
return retval;
|
||||
|
Loading…
Reference in New Issue
Block a user