synclink_gt(): fix compat_ioctl()

compat_ptr() for pointer-taking ones...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2018-09-12 20:57:18 -04:00
parent 50f45326af
commit 27230e5134

View File

@ -1185,14 +1185,13 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct slgt_info *info = tty->driver_data; struct slgt_info *info = tty->driver_data;
int rc = -ENOIOCTLCMD; int rc;
if (sanity_check(info, tty->name, "compat_ioctl")) if (sanity_check(info, tty->name, "compat_ioctl"))
return -ENODEV; return -ENODEV;
DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd)); DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd));
switch (cmd) { switch (cmd) {
case MGSL_IOCSPARAMS32: case MGSL_IOCSPARAMS32:
rc = set_params32(info, compat_ptr(arg)); rc = set_params32(info, compat_ptr(arg));
break; break;
@ -1212,18 +1211,11 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
case MGSL_IOCWAITGPIO: case MGSL_IOCWAITGPIO:
case MGSL_IOCGXSYNC: case MGSL_IOCGXSYNC:
case MGSL_IOCGXCTRL: case MGSL_IOCGXCTRL:
case MGSL_IOCSTXIDLE: rc = ioctl(tty, cmd, (unsigned long)compat_ptr(arg));
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);
break; break;
default:
rc = ioctl(tty, cmd, arg);
} }
DBGINFO(("%s compat_ioctl() cmd=%08X rc=%d\n", info->device_name, cmd, rc)); DBGINFO(("%s compat_ioctl() cmd=%08X rc=%d\n", info->device_name, cmd, rc));
return rc; return rc;
} }