Commit fd74e378 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] jantior: sx: use get/put_user (remove verify_area)

From: Domen Puncer <domen@coderock.org>

Use get_user/put_user to check user addressing,
don't need to use verify_area also.
parent 541f1064
......@@ -1760,9 +1760,7 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
(unsigned int *) arg);
break;
case TIOCSSOFTCAR:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(int))) == 0) {
get_user(ival, (unsigned int *) arg);
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
tty->termios->c_cflag =
(tty->termios->c_cflag & ~CLOCAL) |
(ival ? CLOCAL : 0);
......@@ -1786,27 +1784,21 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
}
break;
case TIOCMBIS:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
((ival & TIOCM_RTS) ? 1 : -1));
sx_reconfigure_port(port);
}
break;
case TIOCMBIC:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sx_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
((ival & TIOCM_RTS) ? 0 : -1));
sx_reconfigure_port(port);
}
break;
case TIOCMSET:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
((ival & TIOCM_RTS) ? 1 : 0));
sx_reconfigure_port(port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment