Skip to content

Commit ab14cae

Browse files
Al ViroLinus Torvalds
authored andcommitted
[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>
1 parent 2c7af51 commit ab14cae

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

‎drivers/char/amiserial.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ static void rs_unthrottle(struct tty_struct * tty)
10891089
*/
10901090

10911091
static int get_serial_info(struct async_struct * info,
1092-
struct serial_struct * retinfo)
1092+
struct serial_struct __user * retinfo)
10931093
{
10941094
struct serial_struct tmp;
10951095
struct serial_state *state = info->state;
@@ -1113,7 +1113,7 @@ static int get_serial_info(struct async_struct * info,
11131113
}
11141114

11151115
static int set_serial_info(struct async_struct * info,
1116-
struct serial_struct * new_info)
1116+
struct serial_struct __user * new_info)
11171117
{
11181118
struct serial_struct new_serial;
11191119
struct serial_state old_state, *state;
@@ -1194,7 +1194,7 @@ static int set_serial_info(struct async_struct * info,
11941194
* transmit holding register is empty. This functionality
11951195
* allows an RS485 driver to be written in user space.
11961196
*/
1197-
static int get_lsr_info(struct async_struct * info, unsigned int *value)
1197+
static int get_lsr_info(struct async_struct * info, unsigned int __user *value)
11981198
{
11991199
unsigned char status;
12001200
unsigned int result;
@@ -1285,6 +1285,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
12851285
struct async_struct * info = (struct async_struct *)tty->driver_data;
12861286
struct async_icount cprev, cnow; /* kernel counter temps */
12871287
struct serial_icounter_struct icount;
1288+
void __user *argp = (void __user *)arg;
12881289
unsigned long flags;
12891290

12901291
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
@@ -1299,19 +1300,17 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
12991300

13001301
switch (cmd) {
13011302
case TIOCGSERIAL:
1302-
return get_serial_info(info,
1303-
(struct serial_struct *) arg);
1303+
return get_serial_info(info, argp);
13041304
case TIOCSSERIAL:
1305-
return set_serial_info(info,
1306-
(struct serial_struct *) arg);
1305+
return set_serial_info(info, argp);
13071306
case TIOCSERCONFIG:
13081307
return 0;
13091308

13101309
case TIOCSERGETLSR: /* Get line status register */
1311-
return get_lsr_info(info, (unsigned int *) arg);
1310+
return get_lsr_info(info, argp);
13121311

13131312
case TIOCSERGSTRUCT:
1314-
if (copy_to_user((struct async_struct *) arg,
1313+
if (copy_to_user(argp,
13151314
info, sizeof(struct async_struct)))
13161315
return -EFAULT;
13171316
return 0;
@@ -1370,7 +1369,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
13701369
icount.brk = cnow.brk;
13711370
icount.buf_overrun = cnow.buf_overrun;
13721371

1373-
if (copy_to_user((void *)arg, &icount, sizeof(icount)))
1372+
if (copy_to_user(argp, &icount, sizeof(icount)))
13741373
return -EFAULT;
13751374
return 0;
13761375
case TIOCSERGWILD:

0 commit comments

Comments
 (0)