From f5d9ebe57e9809ec822c00ec26547a68f8ba2882 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 12 Jan 2006 01:06:30 -0800 Subject: [PATCH] --- yaml --- r: 18127 b: refs/heads/master c: ab14caec7a5f0d9569c8a9dd2ad62e89b220c968 h: refs/heads/master i: 18125: 4546a03454b22f4143d7cd1a3e05ad63fc298bca 18123: 0dd2cec275811519d64d63ae25e79ae311477c19 18119: fad733b61228af10d6566dd5cb3aa27f81d0c192 18111: bc3487d01a248b71e3a0c97b77ef3458960f3195 v: v3 --- [refs] | 2 +- trunk/drivers/char/amiserial.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 6a187e7ea4cd..c0f1590e0e22 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2c7af51129161a7a3dc4169c984964912f1f4822 +refs/heads/master: ab14caec7a5f0d9569c8a9dd2ad62e89b220c968 diff --git a/trunk/drivers/char/amiserial.c b/trunk/drivers/char/amiserial.c index aabb368db935..667a21c72edb 100644 --- a/trunk/drivers/char/amiserial.c +++ b/trunk/drivers/char/amiserial.c @@ -1089,7 +1089,7 @@ static void rs_unthrottle(struct tty_struct * tty) */ static int get_serial_info(struct async_struct * info, - struct serial_struct * retinfo) + struct serial_struct __user * retinfo) { struct serial_struct tmp; struct serial_state *state = info->state; @@ -1113,7 +1113,7 @@ static int get_serial_info(struct async_struct * info, } static int set_serial_info(struct async_struct * info, - struct serial_struct * new_info) + struct serial_struct __user * new_info) { struct serial_struct new_serial; struct serial_state old_state, *state; @@ -1194,7 +1194,7 @@ static int set_serial_info(struct async_struct * info, * transmit holding register is empty. This functionality * allows an RS485 driver to be written in user space. */ -static int get_lsr_info(struct async_struct * info, unsigned int *value) +static int get_lsr_info(struct async_struct * info, unsigned int __user *value) { unsigned char status; unsigned int result; @@ -1285,6 +1285,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, struct async_struct * info = (struct async_struct *)tty->driver_data; struct async_icount cprev, cnow; /* kernel counter temps */ struct serial_icounter_struct icount; + void __user *argp = (void __user *)arg; unsigned long flags; if (serial_paranoia_check(info, tty->name, "rs_ioctl")) @@ -1299,19 +1300,17 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, switch (cmd) { case TIOCGSERIAL: - return get_serial_info(info, - (struct serial_struct *) arg); + return get_serial_info(info, argp); case TIOCSSERIAL: - return set_serial_info(info, - (struct serial_struct *) arg); + return set_serial_info(info, argp); case TIOCSERCONFIG: return 0; case TIOCSERGETLSR: /* Get line status register */ - return get_lsr_info(info, (unsigned int *) arg); + return get_lsr_info(info, argp); case TIOCSERGSTRUCT: - if (copy_to_user((struct async_struct *) arg, + if (copy_to_user(argp, info, sizeof(struct async_struct))) return -EFAULT; return 0; @@ -1370,7 +1369,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, icount.brk = cnow.brk; icount.buf_overrun = cnow.buf_overrun; - if (copy_to_user((void *)arg, &icount, sizeof(icount))) + if (copy_to_user(argp, &icount, sizeof(icount))) return -EFAULT; return 0; case TIOCSERGWILD: