]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
synclink_gt(): fix compat_ioctl()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 13 Sep 2018 00:57:18 +0000 (20:57 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Oct 2018 04:50:52 +0000 (00:50 -0400)
compat_ptr() for pointer-taking ones...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/tty/synclink_gt.c

index b8287a0103365bf4548cec98550ea366d0b254b3..e8a9047de45168b207e14802c6e0c5e764f1c896 100644 (file)
@@ -1185,14 +1185,13 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
                         unsigned int cmd, unsigned long arg)
 {
        struct slgt_info *info = tty->driver_data;
-       int rc = -ENOIOCTLCMD;
+       int rc;
 
        if (sanity_check(info, tty->name, "compat_ioctl"))
                return -ENODEV;
        DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd));
 
        switch (cmd) {
-
        case MGSL_IOCSPARAMS32:
                rc = set_params32(info, compat_ptr(arg));
                break;
@@ -1212,18 +1211,11 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
        case MGSL_IOCWAITGPIO:
        case MGSL_IOCGXSYNC:
        case MGSL_IOCGXCTRL:
-       case MGSL_IOCSTXIDLE:
-       case MGSL_IOCTXENABLE:
-       case MGSL_IOCRXENABLE:
-       case MGSL_IOCTXABORT:
-       case TIOCMIWAIT:
-       case MGSL_IOCSIF:
-       case MGSL_IOCSXSYNC:
-       case MGSL_IOCSXCTRL:
-               rc = ioctl(tty, cmd, arg);
+               rc = ioctl(tty, cmd, (unsigned long)compat_ptr(arg));
                break;
+       default:
+               rc = ioctl(tty, cmd, arg);
        }
-
        DBGINFO(("%s compat_ioctl() cmd=%08X rc=%d\n", info->device_name, cmd, rc));
        return rc;
 }