mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
[PATCH] m68k: amiserial __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
2c7af51129
commit
ab14caec7a
1 changed files with 9 additions and 10 deletions
|
@ -1089,7 +1089,7 @@ static void rs_unthrottle(struct tty_struct * tty)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int get_serial_info(struct async_struct * info,
|
static int get_serial_info(struct async_struct * info,
|
||||||
struct serial_struct * retinfo)
|
struct serial_struct __user * retinfo)
|
||||||
{
|
{
|
||||||
struct serial_struct tmp;
|
struct serial_struct tmp;
|
||||||
struct serial_state *state = info->state;
|
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,
|
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_struct new_serial;
|
||||||
struct serial_state old_state, *state;
|
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
|
* transmit holding register is empty. This functionality
|
||||||
* allows an RS485 driver to be written in user space.
|
* 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 char status;
|
||||||
unsigned int result;
|
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_struct * info = (struct async_struct *)tty->driver_data;
|
||||||
struct async_icount cprev, cnow; /* kernel counter temps */
|
struct async_icount cprev, cnow; /* kernel counter temps */
|
||||||
struct serial_icounter_struct icount;
|
struct serial_icounter_struct icount;
|
||||||
|
void __user *argp = (void __user *)arg;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
|
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) {
|
switch (cmd) {
|
||||||
case TIOCGSERIAL:
|
case TIOCGSERIAL:
|
||||||
return get_serial_info(info,
|
return get_serial_info(info, argp);
|
||||||
(struct serial_struct *) arg);
|
|
||||||
case TIOCSSERIAL:
|
case TIOCSSERIAL:
|
||||||
return set_serial_info(info,
|
return set_serial_info(info, argp);
|
||||||
(struct serial_struct *) arg);
|
|
||||||
case TIOCSERCONFIG:
|
case TIOCSERCONFIG:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case TIOCSERGETLSR: /* Get line status register */
|
case TIOCSERGETLSR: /* Get line status register */
|
||||||
return get_lsr_info(info, (unsigned int *) arg);
|
return get_lsr_info(info, argp);
|
||||||
|
|
||||||
case TIOCSERGSTRUCT:
|
case TIOCSERGSTRUCT:
|
||||||
if (copy_to_user((struct async_struct *) arg,
|
if (copy_to_user(argp,
|
||||||
info, sizeof(struct async_struct)))
|
info, sizeof(struct async_struct)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1370,7 +1369,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
|
||||||
icount.brk = cnow.brk;
|
icount.brk = cnow.brk;
|
||||||
icount.buf_overrun = cnow.buf_overrun;
|
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 -EFAULT;
|
||||||
return 0;
|
return 0;
|
||||||
case TIOCSERGWILD:
|
case TIOCSERGWILD:
|
||||||
|
|
Loading…
Reference in a new issue