Skip to content

Commit 27230e5

Browse files
author
Al Viro
committed
synclink_gt(): fix compat_ioctl()
compat_ptr() for pointer-taking ones... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 50f4532 commit 27230e5

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/tty/synclink_gt.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,14 +1185,13 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
11851185
unsigned int cmd, unsigned long arg)
11861186
{
11871187
struct slgt_info *info = tty->driver_data;
1188-
int rc = -ENOIOCTLCMD;
1188+
int rc;
11891189

11901190
if (sanity_check(info, tty->name, "compat_ioctl"))
11911191
return -ENODEV;
11921192
DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd));
11931193

11941194
switch (cmd) {
1195-
11961195
case MGSL_IOCSPARAMS32:
11971196
rc = set_params32(info, compat_ptr(arg));
11981197
break;
@@ -1212,18 +1211,11 @@ static long slgt_compat_ioctl(struct tty_struct *tty,
12121211
case MGSL_IOCWAITGPIO:
12131212
case MGSL_IOCGXSYNC:
12141213
case MGSL_IOCGXCTRL:
1215-
case MGSL_IOCSTXIDLE:
1216-
case MGSL_IOCTXENABLE:
1217-
case MGSL_IOCRXENABLE:
1218-
case MGSL_IOCTXABORT:
1219-
case TIOCMIWAIT:
1220-
case MGSL_IOCSIF:
1221-
case MGSL_IOCSXSYNC:
1222-
case MGSL_IOCSXCTRL:
1223-
rc = ioctl(tty, cmd, arg);
1214+
rc = ioctl(tty, cmd, (unsigned long)compat_ptr(arg));
12241215
break;
1216+
default:
1217+
rc = ioctl(tty, cmd, arg);
12251218
}
1226-
12271219
DBGINFO(("%s compat_ioctl() cmd=%08X rc=%d\n", info->device_name, cmd, rc));
12281220
return rc;
12291221
}

0 commit comments

Comments
 (0)